I was solving one probability question, and to solve the problem I could relate it to binary and want solution.
The question was that in a fair toss repeated 10 times, what's the probability of 10th try to be the 5'th head.
I used brute-force and calculated it to be 63/512. But I can only brute force for definite numbers. What if I get n and x. So my problem is as stated below.
For all possible combination of a $n$ -bit binary number to have $x $ number of 1's where $x < n$.
Any Helps Will be Appreciated