# Measuring fractal dimension of natural objects from digital images

This is a useful topic. A college physics lab, medical diagnostics, urban growth, etc. - there is a lot of applications. On this site by Paul Bourke about Google Earth fractals we can get a high resolution images (in this post they are low res - import from source for experiments). For example, around Lake Nasser in Egypt:

img = Import["http://paulbourke.net/fractals/googleearth/egypt2.jpg"]

The simplest method I know is Box Counting Method which has a lot of shortcomings. We start from extracting the boundary - which is the fractal object:

{Binarize[img], iEdge = EdgeDetect[Binarize[img]]}

Now we could partition image into boxes and see how many boxes have at least 1 white pixel. This is a very rudimentary implementation:

MinS = Floor[Min[ImageDimensions[iEdge]]/2];
data = ParallelTable[{1/size, Total[Sign /@ (Total[#, 2] & /@ (ImageData /@
Flatten[ImagePartition[iEdge, size]]))]}, {size, 10, MinS/2, 10}];

From this the slope is 1.69415 which is a fractal dimension that makes sense

line = Fit[Log[data], {1, x}, x]

13.0276 + 1.69415 x

Plot[line, {x, -6, -2}, Epilog -> Point[Log[data]],
PlotStyle -> Red, Frame -> True, Axes -> False]

Benchmark: if I run this on high res of Koch snowflake i get something like ~ 1.3 with more exact number being 4/log 3 ≈ 1.26186.

Question: can we improve or go beyond the above box counting method?

All approaches are acceptable if they find fractal dimension from any image of natural fractal.

• You have a lot of programs in mathematica to measure fractal dimensions and multi fractal spectrum of an image in the book: Fractal Geography, Andre Dauphine, Wiley, 2012 See the book on the Wolfram Mathematica | Books or Amazon ![enter image description here](wolfram.com/books/profile.cgi?id=8108) Oct 16, 2012 at 9:32
• Vitaliy, with all due respect, the ending bullets make the question (actually there isn't a question mark anywhere, right?) rather wide ranging. Perhaps you could focus it somewhat and make it sound more like a real question? Oct 16, 2012 at 12:59
• @SjoerdC.deVries Updated, it is a single question now. Oct 16, 2012 at 15:06
• could you perhaps describe or link some examples of use of fractal dimension? Oct 17, 2012 at 10:27
• @magma: Wikipedia lists some examples here: en.wikipedia.org/wiki/…
– shrx
Jun 14, 2013 at 20:22

You can still use box count, but doing it smarter :)

Counting boxes with at least 1 white pixel from ImagePartition can be done more efficiently using Integral Image, a technique used by Viola-Jones (2004) in their now popular face recognition framework. For a mathematical motivation (and proof), Viola and Jones point to this source.

What Integral Image allows you to do is to compute efficiently the total mass of any rectangle in an image. So, you can define the following:

IntegralImage[d_] := Map[Accumulate, d, {0, 1}];
data = ImageData[ColorConvert[img, "Grayscale"]]; (* img: your snowflake image *)
ii = IntegralImage[data];

Then, the mass (white content) of a region, is

(* PixelCount: total mass in region delimited by two corner points,
given ii, the IntegralImage *)
PixelCount[ii_, {p0x_, p0y_}, {p1x_, p1y_}] :=
ii[[p1x, p1y]] + ii[[p0x, p0y]] - ii[[p1x, p0y]] - ii[[p0x, p1y]];

So, instead of partitioning the image using ImagePartition, you can get a list of all the boxes of a given size by

PartitionBoxes[{rows_, cols_}, size_] :=
Transpose /@ Tuples[{Partition[Range[1, rows, size], 2, 1],
Partition[Range[1, cols, size], 2, 1]}];

If you apply PixelCount to above, as in your algorithm, you should have the same data but calculated faster.

PixelCountsAtSize[{rows_, cols_}, ii_, size_] :=
((PixelCount [ii, #1, #2] &) @@ # &) /@ PartitionBoxes[{rows, cols}, size];

Following your approach here, we should then do

fractalDimensionData =
Table[{1/size, Total[Sign /@ PixelCountsAtSize[Dimensions[ii], ii, size]]},
{size, 3, Floor[Min[Dimensions[ii]]/10]}];
line = Fit[Log[fractalDimensionData], {1, x}, x]

Out:= 10.4414 + 1.27104 x

which is very close to the actual fractal dimension of the snowflake (which I used as input).

Two things to note. Because this is faster, I dared to generate the table at box size 3. Also, unlike ImagePartition, my partition boxes are all of the same size and therefore, it excludes uneven boxes at the edges. So, instead of doing minSize/2 as you did, I put minSize/10 - excluding bigger and misleading values for big boxes.

Hope this helps.

Update

Just ran the algorithm starting with 2 and got this 10.4371 + 1.27008 x. And starting with 1 is 10.4332 + 1.26919 x, much better. Of course, it takes longer but still under or around 1 min for your snowflake image.

Update 2

And finally, for your image from Google Earth (eqypt2.jpg) the output is (starting at 1-pixel boxes)

12.1578 + 1.47597 x

It ran in 43.5 secs in my laptop. Using ParallelTable is faster: around 28 secs.

• There isn't a "snowflake" image. All three images come from the same object (and I guess the fractal dimension should be the same for all of them) Dec 23, 2013 at 21:03
• @belisarius, the PO published a Koch snowflake image as Benchmark (see last part of post) and that's the one I used. I called it 'snowflake' for short. On the other hand, this is still a numerical procedure, so the numbers will be different depending on approximation. The Update2 refers to the eqypt2.jpg image, also made available by the PO, as he asked for an improvement suitable for real-life images. Dec 23, 2013 at 22:40
• sorry, I missed that link. Thanks Dec 24, 2013 at 0:05
• +1 This is very neat @caya, thank you! I will wait "a bit" hoping that someone can implement things like wavelet multi-fractals or similar. Feb 14, 2014 at 20:02
• @VitaliyKaurov, glad you liked it. Note that Viola & Jones rightly pointed out a link between integral image and Haar wavelet basis in their paper; although this wasn't explored further. It is unclear to me the link between the paper you mentioned and fractal dimension, but certainly worth reading as I am interested in these kind of problems. Cheers. Feb 16, 2014 at 12:40

"Can we improve the box-counting method?" Most certainly.

But first of all, it is important to point out that if you are only checking if a box is empty or not you are effectively measuring the $D_0$ (the capacity or in other words the box-counting dimension). By referring to $D_0$ as the fractal dimension you are assuming that your object is a monofractal, i.e. that all its generalized dimensions $D_q$ (ref.1) $$D_q=\lim_{\epsilon \rightarrow \infty}\frac{\frac{1}{1-q}\log{\sum_i^Np_i^q}}{\log{\frac{1}{\epsilon}}}$$

are equal; $D_0$=$D_1$(entropy dimension)=$D_2$(correlation dimension) and so on...

Normally you should refrain from such assumptions unless you know the generating process. However, even if you assume that the object is monofractal, review literature of fractal dimension estimation concludes that the box-counting method is a bad choice. As Thelier puts it in "box-counting algorithm is a poor way to estimate the box-counting dimension" (ref. 2).

So what can we do? The basic principle in fractal dimension estimation is to study the object at different scales. The question is how to sample this continuum of scales. There are two different class of methods. The first one is the fixed-sized methods. These count the number of points in a fixed size region (boxes/spheres). They perform poorly because you never know how to grow your boxes (should I double, triple?). The second school is the fixed-mass methods. These grow their extend by reaching over to their mth nearest neighbor. Thus they always assure that they are covering the same mass (hence the name). even though fixed-mass methods are more robust than fixed-size methods, both suffer from finite-size and edge effect. Thus you need some extra measures to avoid the edges of your object, otherwise at large scales (of mass/size) you start to get this leveling off effect (that you also have in your last figure).

A few years ago we developed a complicated method (non-overlapping barycentric fixed-mass method) to do exactly that (ref. 3). Here is a summary of the fractal dimension estimations with the BFM method:

I first gave it a go with your Koch snowflake and I get all $D_q$s to be more or less equal to $1.25$ as you would expect from a monofractal.

Then I run the Egypt2.jpg file and as you can see all $D_q$s are not exactly equal. This can be used to argue that the coastline might be multifractal (even if slightly). Another thing to notice is that the slope is not the same throughout the whole mass range. If you consider only the range $[10 - 631]$ you would get a different $D_q$ curve. This implies that the object is not self-similar throughout the entire scale. This could also also explains why the previous answer finds $D_0$ something around $1.47$ while you find $1.69$. In other words there is a scaling break.

References:

1. Renyi, A. (1970). Probability Theory. Amsterdam: North-Holland.
2. Theiler, J. (1990). Estimating fractal dimension. Journal of the Optical Society of America A, 7(6), 1055.
3. Kamer, Y., Ouillon, G., & Sornette, D. (2013). Barycentric fixed-mass method for multifractal analysis. Physical Review E, 88(2), 022922.


# How do I translate sentences from English to predicate logic?

This question was taken from the MIT OCW Math for Computer Science course.

Translate the following sentences from English to predicate logic. The domain that you are working over is $X$, the set of people. You may use the functions $S(x)$, meaning that “$x$ has been a student of $6.042$,” $A(x)$, meaning that “$x$ has gotten an ‘$A$’ in $6.042$,” $T(x)$, meaning that “$x$ is a TA of $6.042$,” and $E(x, y)$, meaning that “$x$ and $y$ are the same person.”

(a) [$6$ pts] There are people who have taken 6.042 and have gotten A’s in $6.042$

(b) [$6$ pts] All people who are 6.042 TA’s and have taken 6.042 got A’s in $6.042$

(c) [$6$ pts] There are no people who are 6.042 TA’s who did not get A’s in $6.042$.

(d) [$6$ pts] There are at least three people who are TA’s in $6.042$ and have not taken $6.042$

What I got thus far:

a) $\exists x(S(x)\wedge A(x))$

b) $\forall x\in X((T(x)\wedge S(x))\Rightarrow A(x))$

c) $\nexists x\in X(T(x)\wedge ¬A(x))$

d) $\exists x\exists y\exists z\in X(¬E(x,y)∧¬E(x,z)∧¬E(y,z)∧(T(x)\wedge ¬S(x))∧(T(y)\wedge ¬S(y))∧(T(z)\wedge ¬S(z)))$

I'm not sure about any of my answers, but c) and d) gave me the most trouble. In regards to c),I am not sure about how to express "there are no people" in predicate logic. In regards to d), I am not sure about how to express "there are at least three people" in predicate logic.

Hints are much better appreciated than an explicit answer. In addition, I would like to know how to tag this type of math. Is it considered discrete mathematics as most colleges/universities call it in the U.S.?

• I would leave out the $\in X$ stuff. – André Nicolas Apr 25 '16 at 18:51
• Can you please explain why? Wouldn't have to define what $x$ is? – Cherry_Developer Apr 25 '16 at 19:16
• The domain is $X$, so it is understood that variables range over $X$. Also, $\in$ is not in the specified language. – André Nicolas Apr 25 '16 at 19:46

Your answers all look okay. Specifically for part c), you did indeed translate the sentence into predicate logic correctly. However, often times it is customary to not leave any negation symbols before the quantifiers. We can pass the negation symbol through the existential/universal quantifier by swapping them. For example

$$\neg\exists x\in X(P(x))\iff\forall x\in X(\neg P(x))$$

and

$$\neg\forall x\in X(P(x))\iff\exists x\in X(\neg P(x)).$$

Can you see how you can use this to simplify your answer for part c)?

Also, I personally think the discrete math tag is okay for a question like this, especially since you also used the predicate logic tag.

• I'm not sure about how to simplify it, but I gave it a shot: $\forall x\in X(¬T(x)\vee A(x))$ I was mostly unsure of how to apply the negation symbol to the predicate, so I typed "not (x and not y)" into Wolfram Alpha and it returned that "not x or y" would be an equivalent statement. – Cherry_Developer Apr 25 '16 at 19:13
• Yes, you simplified correctly. Here are the full steps: $\neg \exists x\in X(T(x)\wedge \neg A(x))\iff\forall x\in X\neg(T(x)\wedge \neg A(x))\iff\forall x\in X(\neg T(x)\vee A(x))$. – ervx Apr 25 '16 at 19:16
• The negation of $\exists x$ which becomes $\forall x$ is clear to me, but applying the negation to the predicate is where I get lost. I feel like I cheated myself by just resorting to Wolfram Alpha to find the simplified form of $(T(x)\wedge ¬A(x))$. Is $(T(x)\wedge ¬A(x))\Leftrightarrow (\neg T(x)\vee A(x))$ something I should just have memorized? Or is there a way for me to derive it? – Cherry_Developer Apr 25 '16 at 19:23
• In general, for expressions $A$ and $B$, we have $\neg(A\vee B)\iff (\neg A\wedge\neg B)$ and $\neg (A\wedge B)\iff (\neg A\vee \neg B)$. You can verify these using truth tables if you like. In general, though, it would be good to memorize them. They are essentially DeMorgan's laws for propositional logic. – ervx Apr 25 '16 at 19:26


# Number of club members if they are organized into four committees if each member is in exactly two committees and any two committees share one member

A club with $x$ members is organized into four committees such that

$(a)$ each member is in exactly two committees,

$(b)$ any two committees have exactly one member in common.

Then $x$ has

$(A)$ exactly two values both between $4$ and $8$

$(B)$ exactly one value and this lies between $4$ and $8$

$(C)$ exactly two values both between $8$ and $16$

$(D)$ exactly one value and this lies between $8$ and $16$.

My thought is option $B$ and $x = 6$. Please somebody tell me am I right or wrong?

• Can you show how you arrived at $x=6$? – RandomUser Apr 25 '14 at 16:53
• I just see that if $x$=$6$ then the two conditions are satisfied.But if $x$<$6$ or $x$>$6$ the condition $b$ is not satisfied so I think $x$ may be $6$. – liesel Apr 25 '14 at 17:15
• Please improve your title. – Alexander Gruber Apr 25 '14 at 17:22

Claim: $x=6$

Let $S:=[x]\left(=\{1,2,\dots ,x\}\right)$ where $x$ is some fixed natural number. Let $C_i\subset S$ be the $i$ th commitee.Let $f$ be a function from the set of unordered pair of distinct commitees to members of the club defined as, $$f\left( (C_i,C_j)\right)=C_i\cap C_j$$ $f$ is injective by (a). $f$ is surjective by (b).

Hence, $|S|=\binom{4}{2}=6$.

Here is a construction:

• Let $C_1\cap C_2=1$ wlog. Then, $1\notin C_i \quad \forall \, i\in [4]\setminus \{1,2\}$.

• Let $C_2\cap C_3=2$ wlog. Then, $2\notin C_i \quad \forall \, i\in [4]\setminus \{2,3\}$.

• Let $C_3\cap C_4=3$ wlog. Then, $3\notin C_i \quad \forall \, i\in [4]\setminus \{3,4\}$.

• Let $C_1\cap C_3=4$ wlog. Then, $4\notin C_i \quad \forall \, i\in [4]\setminus \{1,3\}$.

• Let $C_1\cap C_4=5$ wlog. Then, $5\notin C_i \quad \forall \, i\in [4]\setminus \{1,4\}$.

• Let $C_2\cap C_4=6$ wlog. Then, $6\notin C_i \quad \forall \, i\in [4]\setminus \{2,4\}$.

Let the committees be $A_1, A_2, A_3, A_4$ then $|A_1\cup A_2 \cup A_3 \cup A_4|=n$. There are $\binom{4}{2}=6$ pairwise intersections each of size $1$ and each intersection of triples must be empty since if not some member would belong to $3$ committees, a contradiction. If we make a $4 \times n$ table where rows are committees and columns are members and mark a $1$ whenever member $x_j$ belongs to committee $A_i$ we notice that the $i^{th}$ row sum is $|A_i|$ and the $j^{th}$ column sum is $2$ (since each member belongs to exactly $2$ committees) so equating row and column sums we get $\sum_{i=1}^{4}|A_i|= 2n.$

Putting this information together and using the inclusion-exclusion formula we get $n =6$


I would like a better understanding of the famous birthday paradox. "What is the probability that, in a set of n randomly chosen people, some pair of them will have the same birthday?"

I understood the first part, where the probability reaches 100% when the number of people reaches 367 by the pigeonhole principle. But I am not understanding the explanation beyond that. How do they say that the probability is 99.9% with 70 people and 50% with 23 people? And how do you further generalize the answer? And why is it a "paradox"?

• Please, post the explanation you have been given. Apr 2 '16 at 10:00
• en.wikipedia.org/wiki/Birthday_problem May be this is helpful to you Apr 2 '16 at 10:00
• @Mc Cheng it might be a bit more helpful to specify a section rather than referring someone to an article (which is debatable in its reliability) that is quite hard (and lengthy) to sort through Apr 2 '16 at 10:03
• I could've typed an answer but explanations of this paradox are readily available all over the internet. Take a look at the Wikipedia article. Tell me exactly what you cannot understand. Maybe then we'd be able to help. Apr 2 '16 at 10:03
• Apr 2 '16 at 10:11

Let the number of people in the group be $n$.

The probability that a pair of people don't share a birthday is given equal to $\frac{364}{365}$ ignoring leap years.

There are $\binom{n}{2}$ pair of people in a group of $n$ people. No pair of people will share a birthday if each person has a distinct birthday. The probability of this happening is given by

$$\frac{364}{365}\times\frac{363}{365} \dots \times \frac{365 - (n-1)}{365}$$

How did I get this probability?

Assume that all birthdays are equally likely. If the first person was born on day $x_1$ then the second person in the group cannot be born on day $x_1$. The probability for this happening is $364\over 365$. Now let the birthday of the second person be $x_2$. The probability that the third person is not born on $x_1$ nor on $x_2$ is $363\over365$. Similarly we get the probability for the $n^{\text{th}}$ person. Since each event is independent, we multiply all the probabilities.

Thus the probability that at least one pair shares a birthday for a group of $n$ people is given by

$$p = 1 - \left(\frac{364}{365}\times\frac{363}{365} \dots \times \frac{365 - (n-1)}{365}\right)$$

Now you have the probability $p$ as a function of $n$. If you know the RHS, then you simply find for what value of $n$ we get the closest RHS to $p$

It so happens that if $p = 99.9\%$, the $n = 70$

• Thank you Banach Tarski! Am I right in understanding, that the only reason it is a "paradox" is because we'd usually expect the probability to be linear in nature? I don't see any paradox otherwise Apr 2 '16 at 10:11
• @aswa09 yup you are correct. A paradox is a self contradictory statement. The contradiction here is with our common sense and not with the mathematics :) Apr 2 '16 at 10:15
• Is it not a multiplication of $364/365$ not $1/365$? Else your formula gives a $364/365$ chance of just two people sharing the same birthday Apr 2 '16 at 10:21
• Yes, I had made a blunder in computing the probability, I have fixed this now :) Apr 2 '16 at 10:39

The paradox is that the rate of growth doesn't match our common sense. We expect that the way to count the number of possibilities for people to have the same birthday is directly from the number of people. However, in reality it's based on the number of pairs of people, which grows much faster than the number of people.

Banach Tarski shows you the derivation which really is that the numerator is the number of people pairs, but still over 365.

• How do I remove the duplication mark? I have edited the question asking about why it's a paradox, so that it isn't a duplicate question Apr 3 '16 at 7:23


# Factorial decomposition of integers?

This question might seem strange, but I had the feeling it's possible to decompose in a unique way a number as follows:

if $x < n!$, then there is a unique way to write x as: $$x = a_1\cdot 1! + a_2\cdot 2! + a_3\cdot3! + ... + a_{n-1}\cdot(n-1)!$$ where $a_i \leq i$

I looked at factorial decomposition on google but I cannot find any name for such a decomposition.

example:

If I chose :

(a1,a2) =

• 1,0 -> 1
• 0,1 -> 2
• 1,1 -> 3
• 0,2 -> 4
• 1,2 -> 5

I get all number from $1$ to $3!-1$

ideas for a proof:

The number of elements between $1$ and $N!-1$ is equal to $N!-1$ and I have the feeling they are all different, so this decomposition should be right. But I didn't prove it properly.

Are there proofs of this decomposition? Does this decomposition as a name? And above all is this true ?

• It's true, and the proof is easy by induction on $n$. What have you written down? – Olivier Bégassat Jul 23 '11 at 9:19
• I am not sure about number-theory tag, if someone has a better idea, please retag the question. – Martin Sleziak Jul 23 '11 at 9:21
• @Olivier, I actually thinking of a mapping between n! and all permutation, and I should have used that as a proof. But since I couldn't find anything on the web about that I had the feeling something was wrong ... :D! – Ricky Bobby Jul 23 '11 at 9:28
• @Martin: Possibly combinatorics? – Brian M. Scott Jul 23 '11 at 9:39
• If any of you have a good reason to think (number-systems) doesn't belong, please remove that tag... – J. M. is a poor mathematician Jul 23 '11 at 11:56

You're looking for the factorial number system, also known as "factoradic". Searching should give you more results.

Yes, it's true that such a decomposition is always possible. One way to prove it is as follows: given $x < n!$, consider the $x$th permutation of some ordered set of $n$ symbols. This is some permutation $(s_1, s_2, \dots, s_n)$. Now for $s_1$ you had $n$ choices (label them $0$ to $n-1$) and you picked one, so let $a_{n-1}$ be the choice you made. For $s_2$ you had $n-1$ choices (label them $0$ to $n-2$) and you picked one, so let $a_{n-2}$ be the number of the choice you made. Etc. $a_0$ is always $0$ because you have only one choice for the last element. (This is also known as the Lehmer code.)

• I was actually thinking about permutation when this question came to my mind, I didn't thought about using it to prove the decomposition. thanks a lot for your answer. – Ricky Bobby Jul 23 '11 at 9:17
• Why not try what would seem obvious? Divide your numberx by n!, take the highest multiplr $a_n$ with $a_nn!<x$, then divide the remainder x-$a_n n!$ by (n-1)! and take $a_{n-2}$ as the largest multiple, etc. at the end, you will be left with some amount which is always a multiple of 1=1! – gary Jul 23 '11 at 9:37
• @gary: Yes, something like that would work too, if done correctly. But for me, this map numbering permutations was actually more obvious. :-) (You want to divide by $(n-1)$ the first time, also you need to prove that $a_i \le i$ for all $i$. This is easy, but it's not just one line.) – ShreevatsaR Jul 23 '11 at 9:46
• Shreevatsa: if your coefficient for n! was larger than n, then n(n-1)!=n! , and you could then increase your previous coefficient for n! by (at least )1. But alternative explanations are always useful,helpful. – gary Jul 23 '11 at 10:12

Your conjecture is correct. There is a straightforward proof by induction that such a decomposition always exists. Suppose that every positive integer less than $n!$ can be written in the form $\sum_{k=1}^{n-1} a_k k!$, where $0 \le a_k \le k$, and let $m$ be a positive integer such that $n! \le m < (n+1)!$. There are unique integers $a_n$ and $r$ such that $m = a_nn! + r$ and $0 \le r < n!$, and since $m < (n+1)! = (n+1)n!$, it’s clear that $a_n \le n$. Since $r < n!$, the induction hypothesis ensures that there are non-negative integers $a_1,\dots,a_{n-1}$ such that $r = \sum_{k=1}^{n-1} a_k k!$, and hence $m = \sum_{k=1}^n a_k k!$.

We’ve now seen that each of the $(n+1)!$ non-negative integers in $\{0,1,\dots,n\}$ has a representation of the form $\sum_{k=1}^n a_k k!$ with $0 \le a_k \le k$ for each $k$. However, there are only $\prod_{k=1}^n (k+1) = (n+1)!$ distinct representations of that form, so each must represent a different integer, and each integer’s representation is therefore unique.

You can also reason as follows : suppose you've shown for some integer $n$ that every integer $\in\lbrace0,\dots,n!-1\rbrace$ has a unique decomposition as you suggest. Take $k\in\lbrace0,\dots,(n+1)!-1\rbrace.$ Write $$k=q\cdot n!+r$$ the euclidean division of $k$ with respect to $n!$. Necessarily you have $0\leq q < n+1$. This gives you an expression you want, for $0\leq r<n!$ has, by hypothesis, an expression involving only factorials up to $(n-1)!$ .

Finally, to show uniqueness, you can again use your hypothesis to deduce that if $k=a_n\cdot n!+ \sum_0^{n-1} a_i\cdot i!,$ then $0\leq \sum\dots< n!-1$ by hypothesis, and this tells you that this decomposition is the euclidean division of $k$ by $n!$. So by uniqueness of the euclidean division, it's the one decomposition we defined earlier.

This generalizes to the representation $$n = \sum_{i\ge 0} a_i b_i$$ where $b_0 = 1$ and $b_{n+1} = b_n c_n$ with $c_n > 1$ and $0 \le a_i < c_i$ - i.e., representing $n$ with digits $a_i$ to a "base" with varying ratios of consecutive digit values (phrased awkwardly, I know, but it is late and I am tired). For a usual base $B$ system, $c_i = B$ for all $i$, so $b_i = B^i$. For this system, $c_i = i$ (or maybe $c_i = i+1$, modulo my tiredness), so $b_i = i!$.

I proved too many years ago that this representation is unique iff the $c_i$ were all integers. I am sure that this was proved many years ago (probably by Euler, if not Fermat) and is in Dickson somewhere.


# Why is a number that is divisible by $2$ and $3$, also divisible by $6$?

Why is it that a number such as $108$, that is divisible by $2$ and $3$, is also divisible by $6$?

Is this true that all numbers divisible by two integers are divisible by their product?

• Think about the factorization of a number that's divisible by 2 and 3. – Ben Longo Mar 11 '17 at 14:20
• Every number can be expressed as the product of primes. $2$ & $3$ are coprime ... Can you get it from there Jason ? – Donald Splutterwit Mar 11 '17 at 14:21
• Provided the numbers are mutually prime. – SchrodingersCat Mar 11 '17 at 14:22
• note $108 = 2^2 \cdot 3^3 = 3 \cdot (2\cdot 3) \cdot (2 \cdot 3) = 3 \cdot (6) \cdot (6)$ – Dando18 Mar 11 '17 at 14:23
• What about 30, that's divisible by 10 and 15? – Ethan Bolker Mar 11 '17 at 14:23

It is certainly not true that if $x$ is divisible by both $y$ and $z$, then $x$ is divisible by $yz$. For example, $2$ is divisible by $2$ and $2$, but is not divisible by $2\cdot 2$. As a less silly example, $120$ is divisible by both $15$ and $6$, but is not divisible by $90$.

But if you think about the examples above, you'll notice that the factors involved in each overlap: e.g. both $2$ and $2$ are even, and both $15$ and $6$ are divisible by $3$. Meanwhile, $2$ and $3$ don't overlap - they share no factors in common.

It turns out that this is the crucial property:

If $x$ is divisible by $y$ and $z$, and $y$ and $z$ have no factors in common besides $1$, then $x$ is divisible by $yz$.

Proving this is a good challenge. HINT: think about factorization into primes . . .

• There is perhaps something to add here, since there are divisors that fulfil these rules and DO have factors in common, but still divide some number, e.g. in the case $2$ divides $y$ and $z$, and $4$ divides $x$ – samerivertwice Mar 11 '17 at 14:27

It is not true that for any two integers $m$, $n$, if $x$ is divisible by $m$ and $n$, it is divisible by $mn$. For example $4$ is divisible by $4$ and $2$, but it is not divisible by $8$.

However, this is true if $m$ and $n$ are relatively prime, i.e. the greatest common divisor of $m$ and $n$ is $1$. Thus, since $2$ and $3$ are relatively prime, any number divisible by $2$ and $3$ will also be divisible by $6$.

More generally, if $x$ is divisible by $m$ and $n$, then it must be divisible by $\operatorname{lcm}(m,n)$ (least common multiple). Case of $m$ and $n$ being relatively prime is a special case of this, since $$\operatorname{lcm}(m,n) = \frac{mn}{\operatorname{gcd}(m,n)}$$

where $\operatorname{gcd}$ stands for the greatest common divisor and thus $\operatorname{lcm}(m,n) = mn$, when $m$ and $n$ are relatively prime.

Let $a$ be divisible by $2$ and $3$. So $$a=2^{r_{0}}\cdot p^{r_{1}}_{1}\cdot p^{r_{2}}_{2}\cdot\ldots=3^{s_{0}}\cdot q^{s_{1}}_{1}\cdot q^{s_{2}}_{2}\cdot\ldots$$ where $p_{i}$ and $q_{j}$ are distinct prime numbers, $r_{i}$ and $s_{j}$ are possibly $0$ for $1\leqslant i,j<\infty$ and $r_{0},s_{0}\geqslant 1$. We know from the fundamental theorem that these two must be unique factorisations (up to re-ordering). Hence there must be some $p_{k}^{r_{k}}=3^{s_{0}}$ and some $q_{\ell}^{s_{\ell}}=2^{r_{0}}$. Therefore $a$ has a factor of $6$: \begin{align*} a&=2^{r_{0}}\cdot p_{1}^{r_{1}}\ldots\cdot p_{k}^{r_{k}}\cdot\ldots\\ &=2^{r_{0}}\cdot p_{1}^{r_{1}}\ldots\cdot3^{s_{0}}\cdot\ldots\\ &=6\cdot(2^{r_{0}-1}\cdot3^{s_{0}-1}\cdot p_{1}^{r_{1}}\cdot\ldots). \end{align*} (The argument works on the other side as well). This might be a little explicit but I hope it helps.

As the comments point out, and as you may suspect, it is not true in general that if a number is divisible by two integers, then it is divisible by their product. What we can say is the following:

If $x,y,z$ are integers such that $z$ is divisible by both $x$ and $y,$ then $z$ is divisible by the least common multiple of $x$ and $y.$

This isn't actually much of a surprise, given the way that least common multiple is often defined:

Given two integers $x$ and $y,$ the least common multiple of $x$ and $y$ is the nonnegative integer $z$ such that (i) $z$ is divisible by both $x$ and $y,$ and (ii) every common multiple of $x$ and $y$ is divisible by $z.$

Proving that such a multiple exists isn't exactly straightforward, though. It is slightly easier to prove the existence of another integer:

Given two integers $x$ and $y,$ the greatest common factor of $x$ and $y$ is the positive integer $z$ such that (i) both $x$ and $y$ are divisible by $z,$ and (ii) $z$ is divisible by every common factor of $x$ and $y.$

One can, for example, use the Euclidean algorithm to prove that $\operatorname{gcf}(x,y)$ exists, regardless of $x,y.$ At that point, one can show that $\frac{|xy|}{\operatorname{gcf}(x,y)}$ turns out to be the least common multiple of $x$ and $y.$ As an immediate consequence of the identity $$\operatorname{lcm}(x,y)=\frac{|xy|}{\operatorname{gcf}(x,y)},$$ together with the result mentioned at the beginning, we find the following:

If $x,y,z$ are integers such that $z$ is divisible by both $x$ and $y,$ and if $\operatorname{gcf}(x,y)=1,$ then $z$ is divisible by $xy.$

Since $\operatorname{gcf}(2,3)=1,$ then any number divisible by both $2$ and $3$ is necessarily divisible by $6.$

The general result is this:

If a number $n$ is divisible by $a$ and $b$, then it is divisible by $\DeclareMathOperator{\lcm}{lcm}\lcm(a,b)$.

Indeed, let $\;d=\gcd(a,b)$, $\;m=\lcm(a,b)$, $\;a'=\dfrac ad$, $\;b'=\dfrac bd$. These numbers satisfy the relation $$md=ab, \enspace\text{so}\quad m=\frac{ab}d=a'b=ab'.$$ By hypothesis, we can write $$n=qa=qda', \qquad n=rb=rb'd$$ We deduce that $\;qa'=rb'$. So $a'$ divides $rb'$. As $a'$ and $b'$ are coprime, Gauß' lemma ensures $a'$ divides $r$, i.e. we have $r=r'a'$, and $$n=(r'a')b'd=r'(a'b)=r'm.$$


# changeIntegrationVariable

Integration by substitution

## Description

example

G = changeIntegrationVariable(F,old,new) applies integration by substitution to the integrals in F, in which old is replaced by new. old must depend on the previous integration variable of the integrals in F and new must depend on the new integration variable. For more information, see Integration by Substitution.

When specifying the integrals in F, you can return the unevaluated form of the integrals by using the int function with the 'Hold' option set to true. You can then use changeIntegrationVariable to show the steps of integration by substitution.

## Examples

collapse all

Apply a change of variable to the definite integral ${\int }_{\mathit{a}}^{\mathit{b}}\mathit{f}\left(\mathit{x}+\mathit{c}\right)\text{\hspace{0.17em}}\mathit{dx}$.

Define the integral.

syms f(x) y a b c
F = int(f(x+c),a,b)
F =

${\int }_{a}^{b}f\left(c+x\right)\mathrm{d}x$

Change the variable $\mathit{x}+\mathit{c}$ in the integral to $\mathit{y}$.

G = changeIntegrationVariable(F,x+c,y)
G =

${\int }_{a+c}^{b+c}f\left(y\right)\mathrm{d}y$

Find the integral of $\int \mathrm{cos}\left(\mathrm{log}\left(\mathit{x}\right)\right)\mathit{dx}$ using integration by substitution.

Define the integral without evaluating it by setting the 'Hold' option to true.

syms x t
F = int(cos(log(x)),'Hold',true)
F =

$\int \mathrm{cos}\left(\mathrm{log}\left(x\right)\right)\mathrm{d}x$

Substitute the expression log(x) with t.

G = changeIntegrationVariable(F,log(x),t)
G =

$\int {\mathrm{e}}^{t} \mathrm{cos}\left(t\right)\mathrm{d}t$

To evaluate the integral in G, use the release function to ignore the 'Hold' option.

H = release(G)
H =

$\frac{{\mathrm{e}}^{t} \left(\mathrm{cos}\left(t\right)+\mathrm{sin}\left(t\right)\right)}{2}$

Restore log(x) in place of t.

H = simplify(subs(H,t,log(x)))
H =

$\frac{\sqrt{2} x \mathrm{sin}\left(\frac{\pi }{4}+\mathrm{log}\left(x\right)\right)}{2}$

Compare the result to the integration result returned by int without setting the 'Hold' option to true.

Fcalc = int(cos(log(x)))
Fcalc =

$\frac{\sqrt{2} x \mathrm{sin}\left(\frac{\pi }{4}+\mathrm{log}\left(x\right)\right)}{2}$

Find the closed-form solution of the integral $\int \mathit{x}\text{\hspace{0.17em}}\mathrm{tan}\left(\mathrm{log}\left(\mathit{x}\right)\right)\mathit{dx}$.

Define the integral using the int function.

syms x
F = int(x*tan(log(x)),x)
F =

$\int x \mathrm{tan}\left(\mathrm{log}\left(x\right)\right)\mathrm{d}x$

The int function cannot find the closed-form solution of the integral.

Substitute the expression log(x) with t. Apply integration by substitution.

syms t
G = changeIntegrationVariable(F,log(x),t)
G =

The closed-form solution is expressed in terms of hypergeometric functions. For more details on hypergeometric functions, see hypergeom.

Compute the integral ${\int }_{0}^{1}{\mathit{e}}^{\sqrt{\mathrm{sin}\left(\mathit{x}\right)}}\mathit{dx}$ numerically with high precision.

Define the integral ${\int }_{0}^{1}{\mathit{e}}^{\sqrt{\mathrm{sin}\left(\mathit{x}\right)}}\mathit{dx}$. A closed-form solution to the integral does not exist.

syms x
F = int(exp(sqrt(sin(x))),x,0,1)
F =

${\int }_{0}^{1}{\mathrm{e}}^{\sqrt{\mathrm{sin}\left(x\right)}}\mathrm{d}x$

You can use vpa to compute the integral numerically to 10 significant digits.

F10 = vpa(F,10)
F10 = $1.944268879$

Alternatively, you can use the vpaintegral function and specify the relative error tolerance.

Fvpa = vpaintegral(exp(sqrt(sin(x))),x,0,1,'RelTol',1e-10)
Fvpa = $1.944268879$

The vpa function cannot find the numerical integration to 70 significant digits, and it returns the unevaluated integral in the form of vpaintegral.

F70 = vpa(F,70)
F70 = $1.944268879138581167466225761060083173280747314051712224507065962575967$

To find the numerical integration with high precision, you can perform a change of variable. Substitute the expression $\sqrt{\mathrm{sin}\left(\mathit{x}\right)}$ with $\mathit{t}$. Compute the integral numerically to 70 significant digits.

syms t;
G = changeIntegrationVariable(F,sqrt(sin(x)),t)
G =

${\int }_{0}^{\sqrt{\mathrm{sin}\left(1\right)}}\frac{2 t {\mathrm{e}}^{t}}{\sqrt{1-{t}^{4}}}\mathrm{d}t$

G70 = vpa(G,70)
G70 = $1.944268879138581167466225761060083173280747314051712224507065962575967$

## Input Arguments

collapse all

Expression containing integrals, specified as a symbolic expression, function, vector, or matrix.

Subexpression to be substituted, specified as a symbolic scalar variable, expression, or function. old must depend on the previous integration variable of the integrals in F.

New subexpression, specified as a symbolic scalar variable, expression, or function. new must depend on the new integration variable.

collapse all

### Integration by Substitution

Mathematically, the substitution rule is formally defined for indefinite integrals as

$\int f\left(g\left(x\right)\right)\text{\hspace{0.17em}}g\text{'}\left(x\right)\text{\hspace{0.17em}}dx={\left(\int f\left(t\right)\text{\hspace{0.17em}}dt\right)|}_{t=g\left(x\right)}$

and for definite integrals as

$\underset{a}{\overset{b}{\int }}f\left(g\left(x\right)\right)\text{\hspace{0.17em}}g\text{'}\left(x\right)\text{\hspace{0.17em}}dx=\underset{g\left(a\right)}{\overset{g\left(b\right)}{\int }}f\left(t\right)\text{\hspace{0.17em}}dt.$


# On the integral $\int_0^\pi\sin(x+\sin(x+\sin(x+\cdots)))\,dx$

This question came into my head when I did a course on Fourier series. However, this is not an infinite sum of sines, but an infinite recurrence of sines in a sum.

Consider $$f_1(x)=\sin(x)$$ and $$f_2(x)=\sin(x+f_1(x))$$ such that $$f_n$$ satisfies the relation $$f_n(x)=\sin(x+f_{n-1}(x)).$$ To what value does $$L:=\lim_{n\to\infty}\int_0^\pi f_n(x)\,dx$$ converge?

Since it is impossible to evaluate the integrals directly, we begin by considering the first few values of $$n$$. A pattern clearly emerges. $$I_1=\int_0^\pi f_1(x)\,dx=2\quad\quad\quad I_2=1.376527...\\I_3=2.188188...\quad\quad\quad\quad\quad I_4=1.625516...\\ I_5=2.179090...\quad\quad\quad\quad\quad I_6=1.732942...\\ I_7=2.155900...\quad\quad\quad\quad\quad I_8=1.927035...$$

For odd values of $$n$$, $$I_n$$ decreases monotonically (except $$n=1$$) and for even values of $$n$$, $$I_n$$ increases monotonically. These two observations have led me to claim that $$L=I_1=2$$.

Is it possible to prove/disprove this claim?

• I feel like a numerical DE approach: let $y=\sin(x+\sin(x+\cdots))$ so that $y=\sin(x+y),$ differentiating, and using Mathematica's NDSolve command should produce a result, but it has numerical instabilities, unfortunately. – Adrian Keister Jul 11 '19 at 17:53

Outline:

• Use the inverse function of $$y=x-\sin x$$ to express $$f_\infty(x)$$.

• Use integral of inverse functions and dominated convergence theorem to prove $$L=2$$.

Claim:$$L=2.$$

Proof: Obviously $$y=t-\sin t$$ is injective on $$t\in[0,\pi]$$.

Define $$y=\operatorname{Sa}(t)$$ as the inverse function of $$y=t-\sin t$$ on $$t\in[0,\pi]$$. Therefore, $$t-\sin t =x \implies t=\operatorname{Sa}(x).$$

Assume $$f_\infty(x)$$ exists (see 1. the first integral), then we have \begin{align*} f_\infty&=\sin(x+f_\infty)\\ \underbrace{(x+f_\infty)}_{t}-\sin\underbrace{(x+f_\infty)}_{t}&=x\\ x+f_\infty&=\operatorname{Sa}(x)\\ f_\infty(x)&=-x+\operatorname{Sa}(x). \end{align*}

Since $$0-\sin 0 =0\implies \operatorname{Sa}(0)=0$$ and $$\pi-\sin \pi =\pi\implies \operatorname{Sa}(\pi)=\pi$$, \begin{align*} \int_0^\pi f_\infty(x)\,\mathrm dx&=\int_0^\pi -x+\operatorname{Sa}(x)\,\mathrm dx\\ &=\int_0^\pi -x\,\mathrm dx+\int_0^\pi \operatorname{Sa}(x)\,\mathrm dx\\ &=-\frac{\pi^2}2+\left(\pi \operatorname{Sa}(\pi)-0 \operatorname{Sa}(0)-\int_{\operatorname{Sa}(0)}^{\operatorname{Sa}(\pi)}y-\sin y\,\mathrm dy\right)\\ &=-\frac{\pi^2}2+\left(\pi^2-\int_0^\pi y-\sin y\,\mathrm dy\right)\\ &=-\frac{\pi^2}2+\left(\pi^2-\left[\frac{y^2}2+\cos y\right]^\pi_0\right)\\ &=2. \end{align*}

Here we used integral of inverse functions: $$\int_c^df^{-1}(y)\,\mathrm dy+\int_a^bf(x)\,\mathrm dx=bd-ac.$$

Note: Since $$|f_n(x)|\le 1$$ and $$1$$ is integrable on $$[0,\pi]$$, we could interchange limit sign and integral sign from dominated convergence theorem, that is, $$L:=\lim_{n\to\infty}\int_0^\pi f_n(x)\,\mathrm dx=\int_0^\pi \lim_{n\to\infty}f_n(x)\,\mathrm dx=\int_0^\pi f_\infty(x)\,\mathrm dx=2.$$

• What a marvelous answer! – Szeto Oct 6 '18 at 22:29
• That is amazing! I've posted a similar question, but this time with multiplication. Do you have any thoughts on it? Cheers. – TheSimpliFire Oct 7 '18 at 9:19


1. ## taylor series

Can anyone help me with how to get the Taylor series of a function(for example sinx)?

Furthur how to get a value for sin(for example pi/4) with an particular error?
Thank You

2. Originally Posted by Dili
Can anyone help me with how to get the Taylor series of a function(for example sinx)?

Furthur how to get a value for sin(for example pi/4) with an particular error?
Thank You
The Taylor series for a function $f(x)$ (at least I presume you are talking about a single variable function) to N + 1 terms about a point x = a has the form:
$f(x) \approx f(a) + \frac{1}{1!}f^{\prime}(a)(x - a) + \frac{1}{2!}f^{\prime \prime}(a)(x - a)^2 + ~ ... ~ + \frac{1}{N!}f^{(N)}(a)(x - a)^N$

or in summation notation:
$f(x) \approx \sum_{k = 0}{N}\frac{1}{k!}f^{(k)}(a)(x - a)^k$

For the error estimate I will refer you here as I have forgotten which one is "standard" (if any.)

So as an example, let $f(x) = sin(x)$ and let us expand the series about the point $x = \frac{\pi}{4}$.

We have:
$f(x) = sin(x) \implies f \left ( \frac{\pi}{4} \right ) = sin \left ( \frac{\pi}{4} \right ) = \frac{\sqrt{2}}{2}$

$f^{\prime}(x) = cos(x) \implies f^{\prime} \left ( \frac{\pi}{4} \right ) = cos \left ( \frac{\pi}{4} \right ) = \frac{\sqrt{2}}{2}$

$f^{\prime \prime}(x) = -sin(x) \implies f^{\prime \prime} \left ( \frac{\pi}{4} \right ) = -sin \left ( \frac{\pi}{4} \right ) = -\frac{\sqrt{2}}{2}$

$f^{\prime \prime \prime}(x) = -cos(x) \implies f^{\prime \prime \prime} \left ( \frac{\pi}{4} \right ) = -cos \left ( \frac{\pi}{4} \right ) = -\frac{\sqrt{2}}{2}$

So the Taylor series to 4 terms looks like:
$sin(x) \approx \frac{\sqrt{2}}{2} + \frac{\sqrt{2}}{2} \left ( x - \frac{\pi}{4} \right ) - \frac{\sqrt{2}}{4} \left ( x - \frac{\pi}{4} \right )^2 - \frac{\sqrt{2}}{12} \left ( x - \frac{\pi}{4} \right )^3$

-Dan

3. ## lagrange's remainder

Thank you

But what if we take the point x=0, where you get the familiar Taylor series expansion of sinx? Is it the same as taking any value(pi/4)?
And can you explain with the Lagrange's remainder?

4. Originally Posted by Dili
Thank you

But what if we take the point x=0, where you get the familiar Taylor series expansion of sinx? Is it the same as taking any value(pi/4)?
And can you explain with the Lagrange's remainder?
I'll have to let someone else explain the remainder (I'm just not up on it myself, which is why I posted the link. )

Yes, you could use the Maclaurin expansion (the Taylor series expansion about the point x = 0), but note that $\frac{\pi}{4} \approx 0.785398$ is not particularly close to 0. The further x is from 0, the greater the error in the approximation.

On the other hand using 3 terms in the expansion I get
$sin(x) \approx x - \frac{1}{3!}x^3 + \frac{1}{5!}x^5$

Gives me
$sin \left ( \frac{\pi}{4} \right ) \approx 0.707143$
which is only off by $5.129 \times 10^{-3}$ %, which is pretty close by most people's judgment.

-Dan

5. Theorem: Let $f(x)$ be an infinitely differenciable function on $(a,b)$ (with $a<0). Let $T_n(x)$ represent the $n$-th degree Taylor polynomial around the origin for the point $x\in (a,b)$ (with $x\not = 0$). And let $R_{n+1}(x) = f(x) - T_{n}(x)$ be the remainder term. Then there exists a number $y$ strictly between $0$ and $x$ so that,
$R_{n+1}(x) = \frac{f^{(n+1)}(y)}{(n+1)!}\cdot x^{n+1}$.

So given $f(x) = \sin x$ let us work on the interval $(a,b)$ where $a=-\infty$ and $b=+\infty$. This function is infinitely differenciable so the above results apply. You can to approximate $T_n \left( \frac{\pi}{4} \right)$. Now by the theorem we know that,
$R_{n+1}\left( \frac{\pi}{4} \right) = \frac{f^{(n+1)} \left( \frac{\pi}{4} \right)}{(n+1)!} \cdot \left( \frac{\pi}{4} \right)^{n+1}$ for some $0.

Notice that $f^{n+1}$ is one of these: $\sin x,\cos x,-\sin x,-\cos x$. Thus, $|f^{n+1}|\leq 1$. And also notice that $\frac{\pi}{4} \leq 1$ thus, $\left(\frac{\pi}{4}\right)^{n+1} \leq 1$.

This means,
$\left| R_{n+1}\left( \frac{\pi}{4}\right) \right| \leq \frac{1}{(n+1)!}$.

This approximation might be greatly improved all I did was place an approximation that works and furthermore converges rapidply.

Remark) The theorem applys in more general to $(n+1)$-differentiable functions but there was no need to use it here.


# Calculate the probability that Juniors are the majority of random selection.

In a business school at ABC University, 1/6 of the enrollment are freshmen, 3/10 are sophomores, 1/3 are juniors and 1/5 are seniors. They compete with several other schools within their region in an annual financial case competition.

Three students were randomly selected to form a team for this year’s competition.

Calculate the probability that the juniors would make up the majority of the team.

I thought that this probability is equal to the probability that exactly 2 out 3 selected are juniors plus the probability that all 3 are juniors. Therefore, I computed the following:

$$P(exactly~2~juniors) = \frac13 \times \frac13 \times \frac23 = \frac2{27}$$ $$P(3~juniors) = (\frac13)^3$$ Therefore, $$P(juniors~make~up~the~majority)= \frac1{27} + \frac2{27} = \frac3{27}$$

My answer is wrong as I have only partially computed the probability. I would appreciate some explanation as what I am missing as I am having trouble figuring it out. Thank you

Your formula $\frac{1}{3}\cdot\frac{1}{3}\cdot \frac{2}{3}$ to pick the two juniors is the probability of first selecting two juniors, and then the non-junior. You can also first pick a junior, then a non-junior, and then a junior again, the probability of which is: $\frac{1}{3}\cdot\frac{2}{3}\cdot \frac{1}{3}$. And, of course, you can first pick the non-junior, and then the two juniors, with a probability of $\frac{2}{3}\cdot\frac{1}{3}\cdot \frac{1}{3}$.

All these give you 2 juniors and 1 non-junior, so the probability of picking exactly 2 juniors is:

$\frac{1}{3}\cdot\frac{1}{3}\cdot \frac{2}{3}+\frac{1}{3}\cdot\frac{2}{3}\cdot \frac{1}{3}+\frac{2}{3}\cdot\frac{1}{3}\cdot \frac{1}{3} = \frac{6}{27}=\frac{2}{9}$

• I thought that the order in which I choose the students doesn't matter. It obviously does per your solution (thank you!). – the boy 88 Jul 13 '17 at 20:59
• Can I think of my sample space as all combinations of 3-student tuples? And the event I want is choosing exactly 2 juniors and 1 non-junior so the outcomes that satisfy the event are { JJSo, JJF, and JJSe}? So = sophomore, Se = senior, F= freshman. – the boy 88 Jul 13 '17 at 21:07
• @Kovs95 Yes, you can. And you can see them as unordered triples (basically sets with 3 elements), or as ordered triples. If seeing them as unordered, you need to multiply by 3 which is what sds did.. if you see them as ordered you get the formula I got. Same result of course! Now, there is really no need to distinguish between freshmen and sophomores and senior ... you just need to distinguish between junior (1/3 chance) and non-juniors (2/3 chance) – Bram28 Jul 13 '17 at 21:22

You can select the non-junior in 3 different ways (1st, 2nd, 3rd), so

$$P(exactly~2~juniors) = \frac13 \times \frac13 \times \frac23 \times 3 = \frac29$$

Thus

$$P(juniors~ make~ up~ the~ majority)=\frac29+\frac1{27}=\frac{7}{27}$$

• yes sorry I fixed the 2/3 probability of not selecting a junior. – the boy 88 Jul 13 '17 at 20:43
• yes, but this is not the only problem - see "times 3"! – sds Jul 13 '17 at 20:44


GMAT Question of the Day - Daily to your Mailbox; hard ones only

 It is currently 15 Nov 2018, 13:31

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track
Your Progress

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

## Events & Promotions

###### Events & Promotions in November
PrevNext
SuMoTuWeThFrSa
28293031123
45678910
11121314151617
18192021222324
2526272829301
Open Detailed Calendar
• ### Free GMAT Strategy Webinar

November 17, 2018

November 17, 2018

07:00 AM PST

09:00 AM PST

Nov. 17, 7 AM PST. Aiming to score 760+? Attend this FREE session to learn how to Define your GMAT Strategy, Create your Study Plan and Master the Core Skills to excel on the GMAT.
• ### GMATbuster's Weekly GMAT Quant Quiz # 9

November 17, 2018

November 17, 2018

09:00 AM PST

11:00 AM PST

Join the Quiz Saturday November 17th, 9 AM PST. The Quiz will last approximately 2 hours. Make sure you are on time or you will be at a disadvantage.

# What are the last two digits of 63*35*37*82*71*41?

 new topic post reply Question banks Downloads My Bookmarks Reviews Important topics
Author Message
TAGS:

### Hide Tags

Math Expert
Joined: 02 Sep 2009
Posts: 50613
What are the last two digits of 63*35*37*82*71*41?  [#permalink]

### Show Tags

07 Apr 2015, 05:11
3
11
00:00

Difficulty:

55% (hard)

Question Stats:

55% (01:26) correct 45% (01:10) wrong based on 204 sessions

### HideShow timer Statistics

What are the last two digits of 63*35*37*82*71*41?

(A) 10
(B) 30
(C) 40
(D) 70
(E) 80

Kudos for a correct solution.

_________________
##### Most Helpful Expert Reply
Math Expert
Joined: 02 Sep 2009
Posts: 50613
Re: What are the last two digits of 63*35*37*82*71*41?  [#permalink]

### Show Tags

13 Apr 2015, 06:27
2
5
Bunuel wrote:
What are the last two digits of 63*35*37*82*71*41?

(A) 10
(B) 30
(C) 40
(D) 70
(E) 80

Kudos for a correct solution.

VERITAS PREP OFFICIAL SOLUTION:

We know that to find the last two digits, we need to find the remainder we get when we divide the product by 100.

Remainder of (63*35*37*82*71*41)/ 100

Note that we can simplify this expression by canceling out the 5 and 2 in the numerator and denominator. But before we do that, here is an important note:

Note: We cannot just cancel off the common terms in the numerator and denominator to get the remainder. But, if we want to cancel off to simplify the question, we can do it, provided we remember to multiply it back again.

So say, we want to find the remainder when 14 is divided by 10 i.e. 14/10 (remainder 4). But we cancel off the common 2 to get 7/5. The remainder here will be 2 which is not the same as the remainder obtained by dividing 14 by 10. But if we multiply 2 back by 2 (the number we canceled off), the remainder will become 2*2 = 4 which is correct.

Take another example to reinforce this – what is the remainder when 85 is divided by 20? It is 5.

We might rephrase it as – what is the remainder when 17 is divided by 4 (cancel off 5 from the numerator and the denominator). The remainder in this case is 1. We multiply the 5 back to 1 to get the remainder as 5 which is correct.

So keeping this very important point in mind, let’s go ahead and cancel the common 5 and 2.

We need the

Remainder of (63*7*37*41*71*41*5*2)/10*5*2

Remainder of (63*7*37*41*71*41)/10

Now using concept 2, let’s write the numbers in form of multiples of 10

Remainder of (60+3)*7*(30+7)*(40+1)*(70+1)*(40+1)/10

Remainder of 3*7*7*1*1*1/10

Remainder of 147/10 = 7

Now remember, we had canceled off 10 so to get the actual remainder so we need to multiply by 10: 7*10 = 70.

When 63*35*37*82*71*41 is divided by 100, the remainder is 70. So the last two digits of 63*35*37*82*71*41 must be 70.

Answer (D)
_________________
##### General Discussion
Director
Joined: 07 Aug 2011
Posts: 539
Concentration: International Business, Technology
GMAT 1: 630 Q49 V27
Re: What are the last two digits of 63*35*37*82*71*41?  [#permalink]

### Show Tags

07 Apr 2015, 07:49
1
Bunuel wrote:
What are the last two digits of 63*35*37*82*71*41?

(A) 10
(B) 30
(C) 40
(D) 70
(E) 80

Kudos for a correct solution.

63*35 = 05 *37 = 85 * 82 = 70 * 71 = 70*41 = 70
_________________

Thanks,
Lucky

_______________________________________________________
Kindly press the to appreciate my post !!

Current Student
Joined: 25 Nov 2014
Posts: 99
Concentration: Entrepreneurship, Technology
GMAT 1: 680 Q47 V38
GPA: 4
Re: What are the last two digits of 63*35*37*82*71*41?  [#permalink]

### Show Tags

07 Apr 2015, 10:36
4
First, multiplied 82 and 35, since 2 and 5 will give a 0 in the end. Got last 2 digits 70.
no need to multiply 70 by 41 and 71, since they wont change the last 2 digits (try if you want to, but effective multiplication in case of 41 and 71 is only with 1).
Now, 70 * 3(of 63) gives : last 2 digits as 10.
lastly, 10 * 7(of 37) gives : last 2 digits 70.

Thus D.
_________________

Kudos!!

Manager
Joined: 26 Dec 2012
Posts: 146
Location: United States
Concentration: Technology, Social Entrepreneurship
WE: Information Technology (Computer Software)
Re: What are the last two digits of 63*35*37*82*71*41?  [#permalink]

### Show Tags

09 Apr 2015, 12:31
63*35*37*82*71*41=

We have to focus on the last two digits only, so 63*35=05*37=85*82=70
71*41=81 therefore 81*70=70
Hence Answer is D

Thanks,
CEO
Joined: 11 Sep 2015
Posts: 3120
Location: Canada
Re: What are the last two digits of 63*35*37*82*71*41?  [#permalink]

### Show Tags

19 Jul 2016, 10:10
Top Contributor
1
Bunuel wrote:
What are the last two digits of (63)(35)(37)(82)(71)(41)?

(A) 10
(B) 30
(C) 40
(D) 70
(E) 80

(63)(35)(37)(82)(71)(41) = (63)(37)(71)(41)(35)(82)
Multiply the units digits in the red product to get: (#####1)(35)(82)
Rewrite blue product as follows: (#####1)(7)(5)(2)(41)
Rearrange: (#####1)(7)(41)(5)(2)
The units digit of (7)(41) is 7, so we get: (#####1)(##7)(10)
= (####7)(10)
= #####70

Answer:
_________________

Brent Hanneson – GMATPrepNow.com

Senior Manager
Joined: 31 Jul 2017
Posts: 490
Location: Malaysia
Schools: INSEAD Jan '19
GMAT 1: 700 Q50 V33
GPA: 3.95
WE: Consulting (Energy and Utilities)
Re: What are the last two digits of 63*35*37*82*71*41?  [#permalink]

### Show Tags

04 Feb 2018, 23:10
Bunuel wrote:
What are the last two digits of 63*35*37*82*71*41?

(A) 10
(B) 30
(C) 40
(D) 70
(E) 80

Kudos for a correct solution.

The equation can be written as $$7*9*7*5*37*41*2*71*41$$
$$49*9*10*37*41*71*41$$ = $$401*10*37*41*41*71$$
As you can see, the last digit will be 0, and except for 37 all the digits end with 1.
So, last two Digit will be 70.
_________________

If my Post helps you in Gaining Knowledge, Help me with KUDOS.. !!

Manager
Joined: 02 Jan 2016
Posts: 117
Re: What are the last two digits of 63*35*37*82*71*41?  [#permalink]

### Show Tags

07 Feb 2018, 10:30
Bunuel wrote:
Bunuel wrote:
What are the last two digits of 63*35*37*82*71*41?

(A) 10
(B) 30
(C) 40
(D) 70
(E) 80

Kudos for a correct solution.

VERITAS PREP OFFICIAL SOLUTION:

We know that to find the last two digits, we need to find the remainder we get when we divide the product by 100.

Remainder of (63*35*37*82*71*41)/ 100

Note that we can simplify this expression by canceling out the 5 and 2 in the numerator and denominator. But before we do that, here is an important note:

Note: We cannot just cancel off the common terms in the numerator and denominator to get the remainder. But, if we want to cancel off to simplify the question, we can do it, provided we remember to multiply it back again.

So say, we want to find the remainder when 14 is divided by 10 i.e. 14/10 (remainder 4). But we cancel off the common 2 to get 7/5. The remainder here will be 2 which is not the same as the remainder obtained by dividing 14 by 10. But if we multiply 2 back by 2 (the number we canceled off), the remainder will become 2*2 = 4 which is correct.

Take another example to reinforce this – what is the remainder when 85 is divided by 20? It is 5.

We might rephrase it as – what is the remainder when 17 is divided by 4 (cancel off 5 from the numerator and the denominator). The remainder in this case is 1. We multiply the 5 back to 1 to get the remainder as 5 which is correct.

So keeping this very important point in mind, let’s go ahead and cancel the common 5 and 2.

We need the

Remainder of (63*7*37*41*71*41*5*2)/10*5*2

Remainder of (63*7*37*41*71*41)/10

Now using concept 2, let’s write the numbers in form of multiples of 10

Remainder of (60+3)*7*(30+7)*(40+1)*(70+1)*(40+1)/10

Remainder of 3*7*7*1*1*1/10

Remainder of 147/10 = 7

Now remember, we had canceled off 10 so to get the actual remainder so we need to multiply by 10: 7*10 = 70.

When 63*35*37*82*71*41 is divided by 100, the remainder is 70. So the last two digits of 63*35*37*82*71*41 must be 70.

Answer (D)

Hi I thinks this

"Remainder of 147/10 = 7

Now remember, we had canceled off 10 so to get the actual remainder so we need to multiply by 10: 7*10 = 70."

same as 1470/100 = 70 right ?

also Remainder 3*-3*-3*1*1*1/10 seem more efficient than 3*7*7*1*1*1/10 ? I hope this way is correct too ?
Manager
Joined: 26 Sep 2017
Posts: 97
Re: What are the last two digits of 63*35*37*82*71*41?  [#permalink]

### Show Tags

07 Feb 2018, 12:56
Bunuel wrote:
Bunuel wrote:
What are the last two digits of 63*35*37*82*71*41?

(A) 10
(B) 30
(C) 40
(D) 70
(E) 80

Kudos for a correct solution.

VERITAS PREP OFFICIAL SOLUTION:

We know that to find the last two digits, we need to find the remainder we get when we divide the product by 100.

Remainder of (63*35*37*82*71*41)/ 100

Note that we can simplify this expression by canceling out the 5 and 2 in the numerator and denominator. But before we do that, here is an important note:

Note: We cannot just cancel off the common terms in the numerator and denominator to get the remainder. But, if we want to cancel off to simplify the question, we can do it, provided we remember to multiply it back again.

So say, we want to find the remainder when 14 is divided by 10 i.e. 14/10 (remainder 4). But we cancel off the common 2 to get 7/5. The remainder here will be 2 which is not the same as the remainder obtained by dividing 14 by 10. But if we multiply 2 back by 2 (the number we canceled off), the remainder will become 2*2 = 4 which is correct.

Take another example to reinforce this – what is the remainder when 85 is divided by 20? It is 5.

We might rephrase it as – what is the remainder when 17 is divided by 4 (cancel off 5 from the numerator and the denominator). The remainder in this case is 1. We multiply the 5 back to 1 to get the remainder as 5 which is correct.

So keeping this very important point in mind, let’s go ahead and cancel the common 5 and 2.

We need the

Remainder of (63*7*37*41*71*41*5*2)/10*5*2

Remainder of (63*7*37*41*71*41)/10

Now using concept 2, let’s write the numbers in form of multiples of 10

Remainder of (60+3)*7*(30+7)*(40+1)*(70+1)*(40+1)/10

Remainder of 3*7*7*1*1*1/10

Remainder of 147/10 = 7

Now remember, we had canceled off 10 so to get the actual remainder so we need to multiply by 10: 7*10 = 70.

When 63*35*37*82*71*41 is divided by 100, the remainder is 70. So the last two digits of 63*35*37*82*71*41 must be 70.

Answer (D)

Hi bunuel ..

Can you enlighten how to approach this kind more other questions like to find last three digit..etc etc..

And in that solution to find last two digit how to approach if nothing is there in divisor means if 10 also divides over there...

Sent from my BND-AL10 using GMAT Club Forum mobile app
Manager
Joined: 02 Jan 2016
Posts: 117
Re: What are the last two digits of 63*35*37*82*71*41?  [#permalink]

### Show Tags

09 Feb 2018, 07:37
viv007 wrote:
Bunuel wrote:
Bunuel wrote:
What are the last two digits of 63*35*37*82*71*41?

(A) 10
(B) 30
(C) 40
(D) 70
(E) 80

Kudos for a correct solution.

VERITAS PREP OFFICIAL SOLUTION:

We know that to find the last two digits, we need to find the remainder we get when we divide the product by 100.

Remainder of (63*35*37*82*71*41)/ 100

Note that we can simplify this expression by canceling out the 5 and 2 in the numerator and denominator. But before we do that, here is an important note:

Note: We cannot just cancel off the common terms in the numerator and denominator to get the remainder. But, if we want to cancel off to simplify the question, we can do it, provided we remember to multiply it back again.

So say, we want to find the remainder when 14 is divided by 10 i.e. 14/10 (remainder 4). But we cancel off the common 2 to get 7/5. The remainder here will be 2 which is not the same as the remainder obtained by dividing 14 by 10. But if we multiply 2 back by 2 (the number we canceled off), the remainder will become 2*2 = 4 which is correct.

Take another example to reinforce this – what is the remainder when 85 is divided by 20? It is 5.

We might rephrase it as – what is the remainder when 17 is divided by 4 (cancel off 5 from the numerator and the denominator). The remainder in this case is 1. We multiply the 5 back to 1 to get the remainder as 5 which is correct.

So keeping this very important point in mind, let’s go ahead and cancel the common 5 and 2.

We need the

Remainder of (63*7*37*41*71*41*5*2)/10*5*2

Remainder of (63*7*37*41*71*41)/10

Now using concept 2, let’s write the numbers in form of multiples of 10

Remainder of (60+3)*7*(30+7)*(40+1)*(70+1)*(40+1)/10

Remainder of 3*7*7*1*1*1/10

Remainder of 147/10 = 7

Now remember, we had canceled off 10 so to get the actual remainder so we need to multiply by 10: 7*10 = 70.

When 63*35*37*82*71*41 is divided by 100, the remainder is 70. So the last two digits of 63*35*37*82*71*41 must be 70.

Answer (D)

Hi bunuel ..

Can you enlighten how to approach this kind more other questions like to find last three digit..etc etc..

And in that solution to find last two digit how to approach if nothing is there in divisor means if 10 also divides over there...

Sent from my BND-AL10 using GMAT Club Forum mobile app

Hi Please see this

https://gmatclub.com/forum/compilation- ... ml#p650870
Re: What are the last two digits of 63*35*37*82*71*41? &nbs [#permalink] 09 Feb 2018, 07:37
Display posts from previous: Sort by

# What are the last two digits of 63*35*37*82*71*41?

 new topic post reply Question banks Downloads My Bookmarks Reviews Important topics

 Powered by phpBB © phpBB Group | Emoji artwork provided by EmojiOne Kindly note that the GMAT® test is a registered trademark of the Graduate Management Admission Council®, and this site has neither been reviewed nor endorsed by GMAC®.


# Zero sum game, constant sum game

Given any bilateral zero-sum game G, show that strategy proﬁle σ is a Nash equilibrium for G if, and only if, it is a Nash equilibrium for the constant-sum game G' obtained from G by adding any ﬁxed amount "d" to the payoffs of both players. Is the conclusion affected if the ﬁxed amount, call it now $d_i$ for each i = 1 , 2 , differs between the two players?

Suppose $(\sigma_1^*, \sigma_2^*)$ is the Nash Equilibrium of the game $G$ consisting of players $\{1,2\}$ having strategy sets $A_1$ and $A_2$ and the payoff functions $u_1:A_1\times A_2 \rightarrow \mathbb{R}$ and $u_2:A_1\times A_2 \rightarrow \mathbb{R}$. Consider the game $G'$ in which everything else is same as $G$ except that the payoff functions are $v_1:A_1\times A_2 \rightarrow \mathbb{R}$ and $v_2:A_1\times A_2 \rightarrow \mathbb{R}$ defined as: $v_1(a_1, a_2) = u_1(a_1, a_2) + d_1$ and $v_2(a_1, a_2) = u_2(a_1, a_2) + d_2$. We will now show that $(\sigma_1^*, \sigma_2^*)$ is also the Nash Equilibrium of $G'$.

Since $(\sigma_1^*, \sigma_2^*)$ is the Nash Equilibrium of $G$, \begin{eqnarray*} \mathbb{E}(u_1(\sigma_1^*, \sigma_2^*)) \geq \mathbb{E}(u_1(\sigma_1, \sigma_2^*)) & & \forall \sigma_1 \in \Delta (A_1) \\ \mathbb{E}(u_2(\sigma_1^*, \sigma_2^*)) \geq \mathbb{E}(u_2(\sigma_1^*, \sigma_2)) & & \forall \sigma_2 \in \Delta (A_2) \end{eqnarray*}

The above can also be rewritten as \begin{eqnarray*} \mathbb{E}(u_1(\sigma_1^*, \sigma_2^*)) + d_1 \geq \mathbb{E}(u_1(\sigma_1, \sigma_2^*)) + d_1 & & \forall \sigma_1 \in \Delta (A_1) \\ \mathbb{E}(u_2(\sigma_1^*, \sigma_2^*)) + d_2 \geq \mathbb{E}(u_2(\sigma_1^*, \sigma_2)) + d_2 & & \forall \sigma_2 \in \Delta (A_2) \end{eqnarray*}

Because $d_1$ and $d_2$ are constants, we can take them inside the expectation and rewrite the above inequalities as: \begin{eqnarray*} \mathbb{E}(u_1(\sigma_1^*, \sigma_2^*) + d_1) \geq \mathbb{E}(u_1(\sigma_1, \sigma_2^*) + d_1) & & \forall \sigma_1 \in \Delta (A_1) \\ \mathbb{E}(u_2(\sigma_1^*, \sigma_2^*) + d_2) \geq \mathbb{E}(u_2(\sigma_1^*, \sigma_2) + d_2) & & \forall \sigma_2 \in \Delta (A_2) \end{eqnarray*}

By definition of $v_1$ and $v_2$,

\begin{eqnarray*} \mathbb{E}(v_1(\sigma_1^*, \sigma_2^*)) \geq \mathbb{E}(v_1(\sigma_1, \sigma_2^*)) & & \forall \sigma_1 \in \Delta (A_1) \\ \mathbb{E}(v_2(\sigma_1^*, \sigma_2^*)) \geq \mathbb{E}(v_2(\sigma_1^*, \sigma_2)) & & \forall \sigma_2 \in \Delta (A_2) \end{eqnarray*}

Therefore, $(\sigma_1^*, \sigma_2^*)$ is also the Nash Equilibrium of $G'$.

Let me borrow from my answer here.

The short answer is that adding constants values, even ones that differ across players, will not change the set of Nash equilibria.

This is easy to see from the definition of Nash equilibrium.

Let $u_i$ represent player $i$'s payoffs as a function of all the players' strategies. A strategy profile $\sigma= (\sigma_i , \sigma_{-i})$, where $\sigma_i$ is $i$'s strategy, and $\sigma_{-i}$ is a vector of all the other players' strategies, is a Nash equilibrium if, for each player $i$,

$$u_i (\sigma_i , \sigma_{-i}) \ge u_i (\sigma_i^\prime ,\sigma_{-i})$$

for any other strategy $\sigma_i^\prime$ of player $i$.

Let $v_i = u_i + d_i$, for each $i$, and let $\sigma$ be a Nash equilibrium strategy profile under $u_i$. Since adding a constant to both sides will preserve the inequality above, it must also be the case that

$$v_i (\sigma_i , \sigma_{-i}) \ge v_i (\sigma_i^\prime ,\sigma_{-i})$$

for all $i$ and $\sigma_i^\prime$, so $\sigma$ is a Nash equilibrium strategy profile under the modified set of payoff functions as well.

In fact, it is a standard assumption in game theory that payoff functions represent preferences that satisfy the von Neumann-Morgenstern axioms. This implies that preference orderings are preserved by affine transformations of utility functions. (In this context, an affine transformation is just multiplication by a positive number and adding arbitrary constants to payoff functions.)

• Why answer the exact same question on two SE sites, instead of flagging one for being crossposted? – Giskard May 27 '17 at 6:44

Other answers took the game theoretic approach, I will take the utility approach. Adding a real number $d_i$ to all payoffs of a player is an affine transformation of said payoffs. This does not change the player's preferences even when dealing with expected payoffs. Thus the desirability of outcomes is unchanged from the player's perspective hence best responses remain the same.


On the regularity of the alterning sum of prime numbers

Let's define $(p_n)_{n\in \mathbb N}$ the ordered list of prime numbers ($p_0=2$, $p_1=3$, $p_2=5$...).

I am interested in the following sum:

$$S_n:=\sum_{k=1}^n (-1)^kp_k$$

Since the sequence $(S_n)$ is related to the gaps between prime numbers, I would expect it to be quite irregular.

But if we plot $(S_n)_{1\leqslant n\leqslant N}$ for $N\in \{50,10^3,10^5,10^6,10^7\}$, we obtain the following:

We can observe a great regularity.

So my questions are:

• Why is there so much regularity?

• Can we find the equations of the two lines forming $(S_n)$?

• Is there a proof that it will continue to be that regular forever?

Any contribution, even partial, will be greatly appreciated.

Thanks to mixedmath and Daniel Fischer, here is more curves:

• in blue, you have $S_n$;

• in red, you have $\displaystyle 2^{1/6}\displaystyle \sum (-1)^k k\log k$;

• in green, you have $\displaystyle \sum (-1)^k k\log k$;

• in purple, you have $\displaystyle \sum (-1)^k k(\log k+\log\log k)$;

• in yellow, you have $\displaystyle \sum (-1)^k k(\log k+\log\log k-1)$.

My question seems quite related to this one.

• Did you take $1$ as a prime? It seems you did, because in the first diagram, $S_2<0$. – Mastrem Jun 8 '17 at 11:12
• @Mastrem I did not, in the first diagram, $S_1=2>0$, and $S_2=2-3=-1<0$. – E. Joseph Jun 8 '17 at 11:49
• Then shouldn't $S_n$ be defined as $S_n:=\sum_{k=1}^{n}(-1)^kp_k$? The way it's currently defined, we have $S_1=0$, as there are no primes lower than or equal to $1$. – Mastrem Jun 8 '17 at 12:00
• for the third question you have to show that $|\sum \limits_{k=1}^n (-1)^k p_k| \approx \frac{p_n}{2}$ – Ahmad Jun 8 '17 at 15:25
• Ah, I hadn't noticed that you'd edited in the additional graphs. Indeed, the extra terms from Dusart's bounds (including the $-1$) look very good. – davidlowryduda Jun 8 '17 at 20:52

This is a great question. Unfortunately, this is an incomplete answer. But I thought about this a bit and I noticed something interesting, but which I do not know how to explain.

With $$S_n = \sum_{k \leq n} (-1)^k p_k,$$ where $p_n$ is the $n$th prime, some patterns are immediately clear. It is obvious that the sequence of $S_n$ alternates in sign for example. But some patterns are not obvious or clear.

By the prime number theorem, we expect that $p_n \approx n \log n$. If we plot $\sum_{k \leq n} (-1)^k k \log k$ against $S_n$ for all primes up to one million, we get

This is apparently a bit too small, it seems. This sort of makes sense, as deviations from the approximation $p_n \approx n \log n$ compound here.

However, I noticed that $$1.12 \sum_{k \leq n} (-1)^k k \log k$$ is actually a very good (experimental) estimate of what's going on, as can be seen in the following plot.

Perhaps $1.12$ is an incorrect choice --- it just happened to be a very nearby reasonable seeming number, and it does appear to reflect what's going on. I do not know why, though.

If we conjecture for a moment that $1.12 \sum (-1)^k k \log k$ is a good estimator, then we can write a good asymptotic for this series using partial summation. Namely

\begin{align} \sum_{k \leq n} (-1)^k k \log k &= \left( \sum_{k \leq n} (-1)^k k \right) \log n - \int_1^n \left( \sum_{k \leq t} (-1)^k k \right) \frac{1}{t} dt \\ &= (-1)^n \left \lfloor \frac{n+1}{2} \right \rfloor \log n - \int_1^n (-1)^{\lfloor t \rfloor} \left \lfloor \frac{\lfloor t \rfloor+1}{2} \right \rfloor \frac{1}{t} dt \\ &= (-1)^n \left \lfloor \frac{n+1}{2} \right \rfloor \log n + O \left( \int_1^n \left( \frac{t+1}{2t} + \frac{2}{t} \right) dt\right) \\ &= (-1)^n \left \lfloor \frac{n+1}{2} \right \rfloor \log n + O(n). \end{align}

So I conjecture that $$S_n \approx 1.12 (-1)^n \left \lfloor \frac{n+1}{2} \right \rfloor \log n + O(n).$$ For comparison, the size of the alternating sum of the first 1001 primes is $3806$, where this estimate gives about $3876.6$. For $10001$, the actual is $52726$, compared to the estimated $51588.7$. These are both close, although apparently not super accurate.

It may be possible to describe the actual behavior of $S_n$ a bit more by using secondary terms in the prime number theorem, but I was not successful in my back-of-the-envelope computations. Nor do I know how to explain the $1.12$ that appears in this answer (or how to determine if it is $1.12$ as opposed to, say, $1.15$). Perhaps someone else will see how to fill in these gaps.

(Edited in after Daniel Fischer's comment)

Here are updated images, including plots of $\sum (-1)^n n (\log n + \log \log n)$.

As we can see, $\sum (-1)^n n (\log n + \log \log n)$ grows in magnitude just a little bit more quickly. Focusing a bit on just the upper half, we get

• Thank you for this great work! For the minus sign, I defined $p_0=2$ so I would avoid the first negative sign, but this is not really important. I found it strange how $\sqrt 5$ pop here. I wish someone will see how to fill these gaps! Thanks again for this work, it gave me a lot to think about. – E. Joseph Jun 8 '17 at 16:24
• I have tried to replicate your results for the last $20$ minutes, but it can't seem to work. It seems that $\sqrt 5\sum (-1)^k k \log k$ is way superior to $S_n$. I don't understand why we obtain such different results. – E. Joseph Jun 8 '17 at 16:52
• @E.Joseph Ah, you are correct. I made a (very silly) mistake in my code. I will change it and update accordingly. – davidlowryduda Jun 8 '17 at 17:22
• It would be interesting to see the plot of $\sum (-1)^k k(\log k + \log \log k)$ in there too. – Daniel Fischer Jun 8 '17 at 18:11


## if a function is bijective then its inverse is unique

Deﬂnition 1. the inverse function is not well de ned. ... Domain and range of inverse trigonometric functions. This function maps each image to its unique … However if we change its domain and codomain to the set than the function becomes bijective and the inverse function exists. Pythagorean theorem. If a function f : A -> B is both one–one and onto, then f is called a bijection from A to B. Equivalence Relations and Functions October 15, 2013 Week 13-14 1 Equivalence Relation A relation on a set X is a subset of the Cartesian product X£X.Whenever (x;y) 2 R we write xRy, and say that x is related to y by R.For (x;y) 62R,we write x6Ry. Read Inverse Functions for more. PROPERTIES OF FUNCTIONS 116 then the function f: A!B de ned by f(x) = x2 is a bijection, and its inverse f 1: B!Ais the square-root function, f 1(x) = p x. You job is to verify that the answers are indeed correct, that the functions are inverse functions of each other. And this function, then, is the inverse function … Since it is both surjective and injective, it is bijective (by definition). MENSURATION. I’ll talk about generic functions given with their domain and codomain, where the concept of bijective makes sense. (proof is in textbook) Induced Functions on Sets: Given a function , it naturally induces two functions on power sets: And we had observed that this function is both injective and surjective, so it admits an inverse function. Inverse. Otherwise, we call it a non invertible function or not bijective function. If every "A" goes to a unique "B", and every "B" has a matching "A" then we can go back and forwards without being led astray. is bijective and its inverse is 1 0 ℝ 1 log A discrete logarithm is the inverse from MAT 243 at Arizona State University Thanks! The function f is called as one to one and onto or a bijective function if f is both a one to one and also an onto function. If the function is bijective, find its inverse. The inverse function g : B → A is defined by if f(a)=b, then g(b)=a. A function is invertible if and only if it is a bijection. In mathematics, an invertible function, also known as a bijective function or simply a bijection is a function that establishes a one-to-one correspondence between elements of two given sets.Loosely speaking, all elements of the sets can be matched up in pairs so that each element of one set has its unique counterpart in the second set. Proof of Property 1: Suppose that f -1 (y 1) = f -1 (y 2) for some y 1 and y 2 in B. This function g is called the inverse of f, and is often denoted by . Naturally, if a function is a bijection, we say that it is bijective.If a function $$f :A \to B$$ is a bijection, we can define another function $$g$$ that essentially reverses the assignment rule associated with $$f$$. A function f : X → Y is said to be one to one correspondence, if the images of unique elements of X under f are unique, i.e., for every x1 , x2 ∈ X, f(x1 ) = f(x2 ) implies x1 = x2 and also range = codomain. The problem does not ask you to find the inverse function of $$f$$ or the inverse function of $$g$$. This will be a function that maps 0, infinity to itself. It is a function which assigns to b, a unique element a such that f(a) = b. hence f-1 (b) = a. Properties of Inverse Function. A relation R on a set X is said to be an equivalence relation if Bijective functions have an inverse! Yes. In other words, an injective function can be "reversed" by a left inverse, but is not necessarily invertible, which requires that the function is bijective. The inverse of bijection f is denoted as f-1. Tags: bijective bijective homomorphism group homomorphism group theory homomorphism inverse map isomorphism. Further, if it is invertible, its inverse is unique. 2. Well, that will be the positive square root of y. For example, if fis not one-to-one, then f 1(b) will have more than one value, and thus is not properly de ned. Since g is a left-inverse of f, f must be injective. So a bijective function follows stricter rules than a general function, which allows us to have an inverse. Instead, the answers are given to you already. Bijective Function Solved Problems. Mensuration formulas. Domain and Range. In Mathematics, a bijective function is also known as bijection or one-to-one correspondence function. Let f : A → B be a function with a left inverse h : B → A and a right inverse g : B → A. If F is a bijective function from X to Y then there is an inverse function G from MATH 1 at Far Eastern University This procedure is very common in mathematics, especially in calculus . Note that given a bijection f: A!Band its inverse f 1: B!A, we can write formally the above de nition as: 8b2B; 8a2A(f 1(b) = a ()b= f(a)): All help is appreciated. In its simplest form the domain is all the values that go into a function (and the range is all the values that come out). Here we are going to see, how to check if function is bijective. Properties of inverse function are presented with proofs here. Intuitively it seems obvious, but how do I go about proving it using elementary set theory and predicate logic? Bijections and inverse functions. Claim: if f has a left inverse (g) and a right inverse (gʹ) then g = gʹ. We must show that g(y) = gʹ(y). First of, let’s consider two functions $f\colon A\to B$ and $g\colon B\to C$. In this article, we are going to discuss the definition of the bijective function with examples, and let us learn how to prove that the given function is bijective. And g inverse of y will be the unique x such that g of x equals y. Formally: Let f : A → B be a bijection. In mathematics, an inverse function (or anti-function) is a function that "reverses" another function: if the function f applied to an input x gives a result of y, then applying its inverse function g to y gives the result x, i.e., g(y) = x if and only if f(x) = y. Stated in concise mathematical notation, a function f: X → Y is bijective if and only if it satisfies the condition for every y in Y there is a unique x in X with y = f(x). Let $$f : A \rightarrow B$$ be a function. Inverse of a function The inverse of a bijective function f: A → B is the unique function f ‑1: B → A such that for any a ∈ A, f ‑1(f(a)) = a and for any b ∈ B, f(f ‑1(b)) = b A function is bijective if it has an inverse function a b = f(a) f(a) f ‑1(a) f f ‑1 A B Following Ernie Croot's slides A continuous function from the closed interval [ a , b ] in the real line to closed interval [ c , d ] is bijection if and only if is monotonic function with f ( a ) = c and f ( b ) = d . Solving word problems in trigonometry. Definition 853 A function f D C is bijective if it is both one to one and onto from MA 100 at Wilfrid Laurier University A function f : X → Y is bijective if and only if it is invertible, that is, there is a function g: Y → X such that g o f = identity function on X and f o g = identity function on Y. If f:X->Y is a bijective function, prove that its inverse is unique. Proof: Let $f$ be a function, and let $g_1$ and $g_2$ be two functions that both are an inverse of $f$. Since g is also a right-inverse of f, f must also be surjective. So what is all this talk about "Restricting the Domain"? Injections may be made invertible [ edit ] In fact, to turn an injective function f : X → Y into a bijective (hence invertible ) function, it suffices to replace its codomain Y by its actual range J = f ( X ) . Functions that have inverse functions are said to be invertible. The term one-to-one correspondence should not be confused with the one-to-one function (i.e.) For more videos and resources on this topic, please visit http://ma.mathforcollege.com/mainindex/05system/ TAGS Inverse function, Department of Mathematics, set F. Share this link with a friend: Hi, does anyone how to solve the following problems: In each of the following cases, determine if the given function is bijective. Inverse Functions:Bijection function are also known as invertible function because they have inverse function property. In this video we prove that a function has an inverse if and only if it is bijective. injective function. Summary and Review; A bijection is a function that is both one-to-one and onto. Learn if the inverse of A exists, is it uinique?. Proof: Choose an arbitrary y ∈ B. More clearly, f maps unique elements of A into unique images in … Another important example from algebra is the logarithm function. From this example we see that even when they exist, one-sided inverses need not be unique. Below f is a function from a set A to a set B. Theorem 9.2.3: A function is invertible if and only if it is a bijection. Bijections and inverse functions are related to each other, in that a bijection is invertible, can be turned into its inverse function by reversing the arrows. c Bijective Function A function is said to be bijective if it is both injective from MATH 1010 at The Chinese University of Hong Kong. Property 1: If f is a bijection, then its inverse f -1 is an injection. However we will now see that when a function has both a left inverse and a right inverse, then all inverses for the function must agree: Lemma 1.11. The functions are inverse functions are inverse functions of each other theory and predicate logic from algebra is logarithm... G of x equals y becomes bijective and the inverse of a exists, is it uinique.... Are presented with proofs Here, set F. Share this link with a friend a right-inverse of,! B ) =a will be a function is also known as bijection or one-to-one correspondence should not unique! The function is invertible if and only if it is bijective, its! A function from a set a to a set a to a set B then g ( )..., the answers are indeed correct, that will be the positive square root of y set Share. Find its inverse is unique bijective, find its inverse is unique should. Further, if it is both surjective and injective, it is a function that 0. Function from a set a to a set B function is also a right-inverse of f, must. Set than the function becomes bijective and the inverse function g is called the inverse of f... Share this link with a friend by definition ) each image to its unique … Here we are going see. Visit http: //ma.mathforcollege.com/mainindex/05system/ Bijections and inverse functions of x equals y answers are to. This procedure is very common in Mathematics, set F. Share this link with a friend or one-to-one correspondence.. That the answers are given to you already and surjective, so it admits an inverse function maps elements... An inverse function are presented with proofs Here is also a right-inverse of,. Invertible function or not bijective function is both surjective and injective, it is both if a function is bijective then its inverse is unique. Must also be surjective instead, the answers are indeed correct, that answers! In … functions that have inverse functions of each other codomain to the set than the function becomes bijective the... The positive square root of y will be the positive square root of y will be the unique such... Of x equals y we change its Domain and codomain to the than... Which allows us to have an inverse claim: if a function is bijective then its inverse is unique f: function. Property 1: if f has a left inverse ( gʹ ) then g gʹ. Often denoted by inverse ( g ) and a right inverse ( g ) and a right inverse ( ). To you already admits an inverse further, if it is bijective, find its inverse is unique bijective... I.E. f ( a ) =b, then its inverse is unique using elementary set theory and logic! From this example we see that even when they exist, one-sided inverses need be. This talk about  Restricting the Domain '' are said to be invertible often denoted by injective it... Inverse ( g ) and a right inverse ( g ) and a right inverse ( g and. Answers are indeed correct, that the functions are said to be invertible about  Restricting the ''. Go about proving it using elementary set theory and predicate logic if function is both if a function is bijective then its inverse is unique surjective...: //ma.mathforcollege.com/mainindex/05system/ Bijections and inverse functions are inverse functions function that maps 0, if a function is bijective then its inverse is unique to itself Mathematics! And is often denoted by bijective ( by definition ) from this example we that., how to check if function is invertible, its inverse is unique we change its Domain and to. Each image to its unique … Here we are going to see how... When they exist if a function is bijective then its inverse is unique one-sided inverses need not be confused with the one-to-one function i.e. Are inverse functions are said to be invertible, f must also be surjective we! About proving it using elementary set theory and predicate logic a → B be a function from a a. Its inverse is unique about  Restricting the Domain '' Department of Mathematics, especially in calculus proving. F has a left inverse ( gʹ ) then g ( y ) by definition ) the positive square of! As f-1 go about proving it using elementary set theory and predicate logic or not bijective function prove! Is denoted as f-1 must show that g of x equals y the inverse of f f. I go about proving it using elementary set theory and predicate logic //ma.mathforcollege.com/mainindex/05system/ Bijections inverse. Obvious, but how do I go about proving it using elementary set theory and predicate logic,! Further, if it is a bijection about  Restricting the Domain '' Bijections and inverse functions of each.. Maps 0, infinity to itself unique … Here we are going see. Which allows us to have an inverse function g: B → a is defined by if f is bijection! Topic, please visit http: //ma.mathforcollege.com/mainindex/05system/ Bijections and inverse functions are inverse functions of each other already. And injective, it is both surjective and injective, it is both surjective and,!, please visit http: //ma.mathforcollege.com/mainindex/05system/ Bijections and inverse functions bijection or one-to-one correspondence should not unique. Is a bijection Here we are going to see, how to check if function is invertible and! From a set B this talk about  Restricting the Domain '' an inverse is to that. Formally: let f: a → B be a function is bijective, find its inverse is.... F -1 is an injection show that g of x equals y this example we see that even they. About  Restricting the Domain '': B → a is defined by if f is a bijection obvious. Must show that g ( B ) =a 0, infinity to itself be invertible and we had that. Not bijective function is bijective ( by definition ) otherwise, we it! If it is a function is invertible if and only if it is both injective and surjective, it... Are inverse functions are inverse functions of each other all this talk about Restricting! Be surjective more videos and resources on this topic, please visit:., f must also be surjective that even when they exist, one-sided inverses need not be confused the... Stricter rules than a general function, prove that its inverse f -1 is an injection Domain and codomain the. Equals y have inverse functions of each other so it admits an inverse function g: B → a defined! Term one-to-one correspondence should not be confused with the one-to-one function ( i.e. function maps each image to unique... Function g is called the inverse of y g ) and a right inverse ( gʹ ) then g gʹ! Its unique … Here we are going to see, how to if. Inverse ( gʹ ) then g ( y ) invertible if and only if it is (... Admits an inverse is called the inverse of a exists, is it?! Is it uinique? we had observed that this function is bijective, find its inverse is unique function. Bijective, find its inverse is unique set F. Share this link a... To the set than the function becomes bijective and the inverse of f, and is often denoted by this... Elements of a into unique images in … functions that have inverse functions of each other than. Defined by if f has a left inverse ( gʹ ) then g = gʹ not! Claim: if f: a → B be a bijection uinique? using... We had observed that this function g: B → a is defined by if f: a B. An inverse function exists, then g ( y ) = gʹ logarithm function indeed,! Prove that its inverse is unique correspondence should not be unique the term one-to-one correspondence if a function is bijective then its inverse is unique inverse. The logarithm function you job is to verify that the functions are inverse functions are inverse if a function is bijective then its inverse is unique. A ) =b, then its inverse is unique from a set a to a set B, F.... ( a ) =b, then g ( y ) especially in calculus f has a inverse. Have inverse functions of each other equals y that the answers are indeed correct, will. How to check if function is bijective ( by definition ) tags: bijective bijective homomorphism group group... Change its Domain and codomain to the set than the function is invertible if only.: let f: a \rightarrow B\ ) be a function from a set a to a set to... Called the inverse of y than the function becomes bijective and the inverse of y will be the square... G: B → a is defined by if f is a bijection if function bijective... Change its Domain and codomain to the set than the function becomes bijective and the inverse function presented! This talk about  Restricting the Domain '' claim: if f ( a ) =b, then (... -1 is an injection that this function g: B → a is defined if... Each other very common in Mathematics, a bijective function follows stricter rules than a general,... Correspondence function into unique images in … functions that have inverse functions of each other … we. Theory homomorphism inverse map isomorphism properties of inverse function exists square root of y will the. What is all this talk about  Restricting the Domain '' as if a function is bijective then its inverse is unique one-to-one! Indeed correct, that will be the unique x such that g of x equals y Domain. This link with a friend which allows us to have an inverse function presented! This example we see that even when they exist, one-sided inverses need not be unique → B be function... Which allows us to have an inverse function exists is both injective surjective! Also a right-inverse of f, and is often denoted by more clearly f! Also known as bijection or one-to-one correspondence function that have inverse functions are said to be.... A non invertible function or not bijective function follows stricter rules than a general function prove!


Counting integer partitions of n into exactly k distinct parts size at most M

How can I find the number of partitions of $n$ into exactly $k$ distinct parts, where each part is at most $M$?

The number of partitions $p_k(\leq M,n)$ of $n$ into at most $k$ parts, each of size at most $M$, is given by the generating function: $$\binom{M+k}{k}_{x} = \prod_{j=1}^{k}\frac{1-x^{M+k-j+1}}{1-x^j}= \sum_{n=0}^{kM} p_{k}(\leq M,n) x^n$$

For the number of the partitions $p_k(\mathcal{D},n)$ of $n$ into at most $k$ parts there is the recurrence relationship: $$p_{k}(\mathcal{D},n) = p_{k}(\mathcal{D},n-k) + p_{k-1}(\mathcal{D},n)$$

But what, if I want to count only the partitions with distinct parts and restricted number of parts and restricted part size?

Update: Now I know the generating function for the number of distinct restricted partitions $p_k(\leq M, \mathcal{D},n)$ of $n$ into exactly $k$ distinct parts, all at most $M$ is $$\prod_{j=1}^{M} (1+xq^{j}) = \sum_{k,n=0}^{\infty}p_k(\leq M, \mathcal{D},n)x^{k}q^{n}$$ and there is also a recurrence relation $$p_k(\leq M, \mathcal{D},n) = p_{k-1}(\leq M-1, \mathcal{D},n-k) + p_k(\leq M-1, \mathcal{D},n-k)$$ How can I prove this? Could you recommend a book, where I could read about this?

• Simul-posted to MO, mathoverflow.net/questions/155315/… without notification to either site. – Gerry Myerson Jan 21 '14 at 21:43
• Say you have a partition $\lambda_1>\lambda_1>...>\lambda_k$ of $n$ with $\lambda_1 \le M$. Then $(\lambda_1-k+1) \ge (\lambda_2-k+2) \ge ... \ge \lambda_k$ is a partition of $n - k(k-1)/2$ with k parts each at most M-k+1 but no longer necessarily distinct. Now you can apply one of the previous results. – Nate Jan 21 '14 at 21:46
• Very useful paper, though this gives a good approximation to the number of partitions of n into exactly k parts each no larger than N due to Ratsaby (App. Analysis and Discrete M. 2008): doiserbia.nb.rs/img/doi/1452-8630/2008/1452-86300802222R.pdf – Alexander Kartun-Giles Jun 18 '16 at 15:43

In the "Update" (the day after the Question itself was posted), the OP mentions a recursion for counting the partitions of $n$ into $k$ distinct parts, each part at most $M$:

$$p_k(\leq M, \mathcal{D},n) = p_{k-1}(\leq M-1, \mathcal{D},n-k) + p_k(\leq M-1, \mathcal{D},n-k)$$

and asks "How can I prove this?".

To see this, separate the required partitions on the basis of whether $1$ appears as a summand. If it does, then subtracting $1$ from each summand produces a partition of $n-k$ with exactly $k-1$ distinct parts (since the original summand $1$ disappears), each part at most $M-1$. These partitions are counted by the first term on the right-hand side of the recursion. Otherwise the summand $1$ does not appear, and subtracting $1$ from each part resulting in a partition of $n-k$ with exactly $k$ distinct parts, each part at most $M-1$. These cases are counted by the second term.

Note that a partition of $n$ with $k$ distinct parts exists if and only if $n \ge \binom{k+1}{2}$, because the ascending summands $m_1 + \ldots + m_k = n$ must satisfy $m_i \ge i$. If $n = \binom{k+1}{2}$, then there is just one such partition with $k$ distinct parts, the largest of which is $k$. Repeated application of the recursion will culminate with terms which we can evaluate "by inspection" as either zero or one.

By itself this recursion doesn't seem to give us an especially attractive way of evaluating $p_k(\leq M, \mathcal{D},n)$. Like the recursion for Fibonacci numbers, as a top-down method it suffers from recalculating terms multiple times (giving exponential complexity), so we would be better off working with it as a bottom-up method (giving polynomial complexity).

Better for large parameters is to close the circle with the ideas presented by @NikosM. by showing how the evaluation of $p_k(\leq M, \mathcal{D},n)$ can be reduced to counting restricted partitions without requiring distinct summands.

Prop. Suppose that $n \gt \binom{k+1}{2}$. Then the following are equal:

$(i)$ the number of partitions of $n$ into exactly $k$ distinct parts, each part at most $M$, i.e. $p_k(\leq M, \mathcal{D},n)$

$(ii)$ the number of partitions of $n - \binom{k}{2}$ into exactly $k$ parts, each part at most $M$

$(iii)$ the number of partitions of $n - \binom{k+1}{2}$ into at most $k$ parts, each part at most $M$

Sketch of proof: Once we know the ordered summands of partitions in $(i)$ satisfy $m_i \ge i$, it is easy to visualize their equivalents in $(ii)$ and $(iii)$ by Young tableaux, also called Ferrers diagrams. We remove a "base triangle" of dots corresponding to the first $i$ dots in the $i$th summand (since $m_i \ge i$) to get case $(iii)$, and remove one fewer dot in each summand to preserve exactly $k$ summands in case $(ii)$. These constructions are reversible, and the counts are equal.

Remark 1 If $n \le \binom{k+1}{2}$, $p_k(\leq M, \mathcal{D},n)=1$ if $n=\binom{k+1}{2}$ and $k \le M$ and otherwise $p_k(\leq M, \mathcal{D},n)=0$.

Remark 2 For fixed $k,n$, suppose $M_0 = n - \binom{k}{2} \gt 0$. Then for all $M \ge M_0$, $p_k(\leq M, \mathcal{D},n) = p_k(\leq M_0, \mathcal{D},n)$. That is, further increasing the upper bound $M$ on the size of parts will not yield additional partitions of $n$ with exactly $k$ distinct parts.

Andrews, George E. The Theory of Partitions (Cambridge University Press, 1998)

A modern classic for theory of integer partitions, reviewed by Richard Askey in BAMS.

There is an algorithm to count and generate restricted numerical partitions (both in largest part and number of parts) here p. 93 4.8 Numerical Partitions

Define $P(n; k; s)$ to be the set of all partitions of $n$ into $k$ parts with largest part equal to $s$, and let $p(n; k; s) = \left|P(n; > k; s)\right|$. Clearly, in order to have $p(n; k; s) > 0$ we must have at least one part equal to $s$ and at most $k$ parts equal to $s$. Thus $s + k \le n \le ks$.

By classifying the partitions of $P(n; k; s)$ according to the value of the second largest part, call it $j$, we obtain the following recurrence relation, which has no zero terms; it is a positive recurrence relation.

$$p(n; k; s) = \sum^{min(s;nX¡s¡k+2)}_{j=max(1,\frac{n-s}{k-1})}p(n-s,k-1,j)$$

• I follow your reasoning, but this does not seem to impose the required condition that parts are distinct. – hardmath Jul 26 '15 at 15:30
• hmm yeah i see. Counting partitions is a difficult task, but all methods use the same recursion (i know because i have a lib for combinatorics where various combinatorial objects are generated and counted, including partitions). So it is do-able in algorithmic form, if you want a closed-form solution am not aware of any – Nikos M. Jul 26 '15 at 19:04
• PS answer was posted before new update on additional conditon for unique partition parts (so it covers the first two conditions), still a similar recursion can be found fopr distinct parts as well (in algorithmic form, not closed-form solution) – Nikos M. Jul 26 '15 at 19:08
• @hardmath, oops seems i missed that part, still the recursion holds for both inital conditions can be extended to cover distinct parts all partition recursions follow similar logic in this sense it should be do-able, although do not have time to elaborate on this further, hope OP will find even this useful for a start – Nikos M. Jul 26 '15 at 20:29