How many solutions in integers are there to the equation $_1+_2+⋯+_{500}=340$ , such that for every $: 0≤_≤1$?
At first I tried using the inclusion exclusion principle, as in: 340 balls spreaded into 500 compartments s.t every compartment can get zero or one balls.
Not sure how to proceed from here..
Because each $x_i$ where $0 \leq i \leq 500$ is either a $0$ or a $1$, You could similarly ask:
How many ways are there to generate a binary string with a length of 500 which contains exactly 340 $1$s and 160 $0$s.
There is a total of ${500}\choose{340}$ to place the $1$s in the binary string, and the rest of the $0$s go into the remaining places, which is the answer to your question.