A and B are the only candidates who contest in an election. They secure 1 1 and 7 votes, respectively. In how many ways can this happen if it is known that A stayed ahead of B throughout the counting process of votes?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Thank you for the solution. The link had a beautiful proof by reflection.
@Brian Charlesworth , we really liked your comment, and have converted it into a solution. If you subscribe to this solution, you will receive notifications about future comments.
Could u pls explain it a little more?
Thanks for the solution
i do not know the solution through combinatorics. I solved it by writing recursive code for the counting process(it's in c).
#include <stdio.h>
int count=0; //number of ways
const int Amax=11;
const int Bmax=7; //final vote count
void vote(int a, int b){ //a & b are their current vote counts
if(a==Amax||b==Bmax){ //Base case
count++;
return;
}
vote(a+1, b); //let one vote for A and we proceed counting
if(b<a-1){
vote(a, b+1); //let one vote for B & counting ahead
}
}
int main() {
vote(0, 0);
printf("%d", count);
return 0;
}
you can run this code for different values of votes.
just change Amax & Bmax in lines #3 & #4
remember Amax>Bmax
I do not know how to solve this problem yet. It appeared in an exam that I took. In the solutions, only the following formula was given:
( m + n n ) × ( m + n ) ( m − n ) = 7 0 7 2
Where, m = 1 1 , n = 7 and ( N r ) is the coefficient of x r in ( 1 + x ) N .
Please post ideas/solutions. Thanks!
I didn't know about ballot box problem, so I solved using my own technique as follows
Where n 1 n 2 denotes A has got n 1 votes while B has got n 2 votes. The values in () are the number of ways to get to n 1 n 2 . The idea is similar to pascal's triangle with the restrictions.
Problem Loading...
Note Loading...
Set Loading...
This is known as the ballot box problem .
With A getting p votes and B getting q votes, with p > q , the general solution is
( p − 1 p + q − 1 ) − ( p p + q − 1 ) .
In this case we have p = 1 1 and q = 7 , and thus the solution is
( 1 0 1 7 ) − ( 1 1 1 7 ) = 7 0 7 2 .
Proofs are provided in the link.