I'm trying to solve this question, but I'm not quite there and need some help.
Question: Adam has just recovered from a serious leg injury and is encouraged to walk to aid his recovery. On day 1, he is allowed to take 1 walk to the cafeteria, on day 2 he is allowed to take 2 walks, and so on. Adam ends up staying N days, during which he makes 3 walks to the cafeteria in total. In how many different ways is this possible?
Here's my approach:
define Adam's stay as $A$ where each $a_i$ $\in$ $A$ corresponds to a day or number of walks he can take $$ A = (a_1, a_2, ..., a_n) $$
define $$ f(a) = (a_1 - 1, a_2 - 2, a_3 -3, ..., a_n - n) $$
forming a bijection from the set of possible ways to take walks into the set of weak compositions.
As a result:
$$ \sum_{i =0 }^{n} f(a_i) = 3 - \frac{n(n-1)}{2}$$
As a result, we get the following formula for weak compositions
$$3 - \frac{n(n-1)}{2} + n - 1 \choose n$$
I'm not sure how to proceed from here to get a concrete number/answer, is this even the correct line of reasoning?
Suppose he takes walks on separate days. There are $\dbinom{N}{3}$ ways for that to happen.
Suppose he takes two walks on one day and one walk on a second day. First choose the day he takes the two walks, then choose the day he takes his single walk. There are $N-1$ days he can take two walks (as he is only able to do that on day 2 or beyond). Once that day is chosen, there are $N-1$ days remaining where he can take one walk. Thus, there are $(N-1)^2$ ways for him to take one walk one day and two walks on a different day.
Finally, suppose he takes three walks all on the same day. There are $N-2$ days to choose (as he cannot take three walks on days 1 or 2).
Adding this up, there are:
$$\dbinom{N}{3}+(N-1)^2+N-2 = \dfrac{N^3+3N^2-4N-6}{6}$$
ways for him to take his walks.
Another method, let $a_i$ be the number of walks he takes on day $i$:
$$a_1+\cdots+a_n = 3$$
We can look at all possible ways without restriction and subtracting off "forbidden cases":
Forbidden cases: (1) he takes at least two walks on day one or (2) he takes all three walks on day 2:
$$\dbinom{3+n-1}{3}-\dbinom{1+n-1}{1}-\dbinom{0+n-1}{0} = \dfrac{n^3+3n^2-4n-6}{6}$$
So, either way gives the same result.