0

What I have so far is using inclusion/exclusion on $$x_1 + x_2 + x_3 + x_4 = 21$$ with the restrictions that $x_i \leq 9$, I get:

$$C(24,3)-C(4,1)C(14,3)+C(4,2)C(4,3)$$

I know this is the incorrect solution, but I cannot figure out where I went wrong. If someone could tell me what I have missed or if I've gone in the wrong direction that would be appreciated.

N. F. Taussig
  • 79,074

1 Answers1

3

It looks like you have correctly followed the algorithm in this answer.

However, you overlooked that you must deduct all integer solutions to

$$0 + x_2 + x_3 + x_4 = 21 ~: ~0 \leq x_i \leq 9 ~: ~i \in \{2,3,4\}.$$

That is, you overlooked that you have to deduct all solutions where the leftmost digit is $0$.


An alternative approach would have been:

  • $x_1 + x_2 + x_3 + x_4 = 21$

  • $x_1,x_2,x_3,x_4 \in \Bbb{Z_{\geq 0}}.$

  • $x_1, x_2, x_3, x_4 $ each $~< 10.$

  • $x_1 \geq 1.$

The above could then have been bijected to

$y_1 = x_1 - 1 ~: 0 \leq y_1 \leq 8.$

Then you have that $y_1 + x_2 + x_3 + x_4 = 20.$

user2661923
  • 42,303
  • 3
  • 21
  • 46
  • Oh, because x_1 cant be 0, just to make sure how would the final solution look? Thanks for clarifying! – freeantivirus Nov 26 '22 at 04:48
  • @freeantivirus Consider the editing that I just placed at the end of my answer. Consider enumerating the number of solutions to $y_1 + x_2 + x_3 + x_4 = 20 ~: ~y_1 \leq 8.$ Let me know if you still have questions. – user2661923 Nov 26 '22 at 04:50