Teams India and Australia play a series of 7 matches. Each team has an equal probability of winning a match, and no match ends in a draw. If the probability that Team India wins at least three consecutive matches can be expressed as q p , where p and q are coprime positive integers, find p + q .
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.
I use dynamic programming to solve this kind of problem, the state is memo[pos][udh] , pos is the position where you are now , and udh is the number of match already won by india consecutively
..
We know that the number of possibility of the game is 2^7=128. We want to find the number of game where india won at most 2 consecutive game , and then subtract it from 128.
..
the recursive structure is
IF(udh==2) memo[pos][udh]=f(pos+1,0)
else memo[pos][udh]=f(pos+1,udh+1)+f(pos+1,0);
base case is when pos==7 return 1;
..
We build the DP table with bottom up manner
..
memo[7][0]=1;
memo[7][1]=1;
memo[7][2]=1;
memo[6][0]=memo[7][0]+memo[7][1]=2;
memo[6][1]=memo[7][0]+memo[7][2]=2;
memo[6][2]=memo[7][0]=1;
memo[5][0]=memo[6][0]+memo[6][1]=4;
memo[5][1]=memo[6][0]+memo[6][2]=3;
memo[5][2]=memo[6][0]=2;
memo[4][0]=memo[5][0]+memo[5][1]=7;
memo[4][1]=memo[5][0]+memo[5][2]=6;
memo[4][2]=memo[5][0]=4;
memo[3][0]=memo[4][0]+memo[4][1]=13;
memo[3][1]=memo[4][0]+memo[4][2]=11;
memo[3][2]=memo[4][0]=7;
memo[2][0]=memo[3][0]+memo[3][1]=24;
memo[2][1]=memo[3][0]+memo[3][2]=20;
memo[2][2]=memo[3][0]=13;
memo[1][0]=memo[2][0]+memo[2][1]=44;
memo[1][1]=memo[2][0]+memo[2][2]=37;
memo[1][2]=memo[2][0]=24;
result=memo[1][0]+memo[1][1]=81;
..
128-81=47 47/128 , p+q=175.
..
sorry if the solution is messy ^_^
Great, this idea can be formalized by creating the recurrence relations:
A ( n ) is the number of series of n matches where India wins at least 3 consecutive matches
B ( n ) is the number of series of n matches where India does not win at least 3 consecutive matches and lost the last match
C ( n ) is the number of series of n matches where India does not win at least 3 consecutive matches, lost the second last match and won the last match
D ( n ) is the number of series of n matches where India does not win at least 3 consecutive matches, lost the third last math and won both of the last 2 matches
What is the recurrence relation that your recursive structure states?
Its a bit but anyways nyc one.
There are 2 7 = 128 total arrangements since every match is either a win or a loss for each side
Assigning i for team India & a for team Australia, 3 consecutive winning for team India is form of:
Total number of arrangement is 47, with probability 1 2 8 4 7 ⇒ p + q = 4 7 + 1 2 8 = 1 7 5
Problem Loading...
Note Loading...
Set Loading...
Since one team win, another team will lose, so we just have to look at one team (in this solution, team India).
Total number of all different situation: q = 7 P 0 + 7 P 1 + 7 P 2 + 7 P 3 + 7 P 4 + 7 P 5 + 7 P 6 + 7 P 7 (7 P 0 means team India has 0 losses, 7 wins, and 7 P 1 means 1 losses and 6 wins, and so on.)
If team India wins 0, 1, 2 games: p = 0
If team India wins 3 games: p = 5 P 1 = 5 ( Treat three consecutive winnings as a group and perform permutation)
If team India wins 4 games: p = 5 P 2 × 2 - 4 = 16 ( There are two ways of grouping three consecutive winnings and there can only be once 4 consecutive winnings )
If team India wins 5 games: when team India lost in 2nd and 4th games, or in 3rd and 5th games, or in 3rd and 6th games, the 3 consecutive winnings are broken. So p = 7 P 2 - 3 = 18
If team India wins 6 games: p = 7 since no matter which game team India loses, the consecutive winning will be at least 3.
If team India wins 7 games: p = 1
Adding all p will give you 47
Then p + q = 47 + 128 = 175