0

How many functions $f: A \rightarrow \mathbb{N}$ are there with $A:= \{1,\dots,5\}$ where the following equation is satisfied:

$$f(1) + f(2) + f(3) + f(4) + f(5) = 20$$

  • How can I find the number of functions that fit this question? The only principle of counting functions I know is counting the number of functions between two finite sets so I am unsure if I can apply any of that here
jn025
  • 989

3 Answers3

5

Consider the set of all $5$-tuples $(x_1, x_2, x_3, x_4, x_5)$ that satisfy: $$ x_1 + x_2 + x_3 + x_4 + x_5 = 15 $$ where for each $i \in \{1, \ldots, 5\}$, we have that $x_i$ is a nonnegative integer (so that $x_i$ could be zero). Then: \begin{align*} f(1) &= 1 + x_1 \\ f(2) &= 1 + x_2 \\ f(3) &= 1 + x_3 \\ f(4) &= 1 + x_4 \\ f(5) &= 1 + x_5 \\ \end{align*} defines a unique function $f\colon A \to \mathbb N$ that satisfies the given equation. Now to count such $5$-tuples, we use a stars-and-bars argument. There is a one-to-one correspondence between such $5$-tuples and strings of $15$ stars and $5 - 1 = 4$ bars; for example, $(3, 0, 5, 5, 2)$ corresponds to: $$ \star \star \star \mid \mid \star \star \star \star \star \mid \star \star \star \star \star \mid \star \star $$ The number of strings of such stars-and-bars is precisely: $$ \binom{19}{15} = \frac{19!}{15!4!} = 3876 $$

Adriano
  • 41,576
0

Hint : Your functions $f$ are supposed to go in $\mathbb{N}$. But what happens if for some $i$, $f(i)>20$ ? Deduce from your answer to this question that your are looking for functions from $A$ to $\{1,...,20\}$ and then apply your knowledge about counting functions between two finite sets.

  • But it states that A must be {1..5}? – jn025 Apr 28 '15 at 07:50
  • There are $20^5$ functions from $A$ to ${1,\ldots,20}$, but what does that have to do with this problem? – TonyK Apr 28 '15 at 08:09
  • Indeed, I dont get the point of this answer – Paolo Leonetti Apr 28 '15 at 08:10
  • @TonyK, well from what I have read in the question :"the only principle of counting functions I know is counting the number of functions between two finite sets so I am unsure if I can apply any of that here", the problem faced is that functions are going to $\mathbb{N}$ and not to a finite set. I have just said that there is no problem because $\mathbb{N}$ can easily replaced by ${1,...,20}$. Then it just reduces to "how to make $20$ summing $5$ integers" which is an easy problem (assumed to be known in my answer, BTW +1 to Adriano). – Clément Guérin Apr 28 '15 at 08:43
0

I guess that $\mathbb{N}$ is the set of positive integers, in particular $0\notin \mathbb{N}$.. Hence, we are searching for how many (ordered) 5-uples (a,b,c,d,e) of positive integers are such that $$ a+b+c+d+e=20. $$ Suppose we have 20 consecutive boxes. Choosing 4 of them, and noone of them being the first one, we have a 1-1 bijection with the ordered solution of the equation. Therefore the answer is $$\binom{19}{4}.$$

Paolo Leonetti
  • 15,423
  • 3
  • 24
  • 57
  • Why choose 4? or are you just using it as an example and in this case I would choose 5? – jn025 Apr 28 '15 at 07:59
  • it is not a mistake: when you choose 4 boxes, then automatically you divide the 20boxes into 5 consecutive groups ;) – Paolo Leonetti Apr 28 '15 at 08:06
  • This answer is wrong. – TonyK Apr 28 '15 at 08:06
  • What should be the answer? – Paolo Leonetti Apr 28 '15 at 08:07
  • See Adriano's answer. You can see that this answer is wrong by substituting $5$ for $20$: your method would give $\binom{5}{4}=5$, but the correct answer is $\binom{4}{4}=1$. – TonyK Apr 28 '15 at 08:10
  • Oh right, the first one cannot be chosen. Otherwise a group can be empty. – Paolo Leonetti Apr 28 '15 at 08:13
  • Anyway, even if the idea is similar, Adriano's answer is quite different since it assumes $x_i$ to be non-negative, which is a known case.. – Paolo Leonetti Apr 28 '15 at 08:15
  • Here is another way of solving the problem in the positive integers. We have $20$ ones. There are $19$ spaces between them. A particular solution corresponds to a choice of which $4$ of the $19$ spaces to fill with addition signs. For instance, $1 1 + 1 1 1 1 + 1 1 1 1 1 1 + 1 + 1 1 1 1 1 1 1$ corresponds to the solution $a = 2$, $b = 4$, $c = 6$, $d = 1$, and $e = 7$. Therefore, there are $\binom{19}{4}$ solutions of the equation $a + b + c + d + e = 20$ in the positive integers. – N. F. Taussig Apr 28 '15 at 09:44