Distance between color change in playing cards
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Suppose we have a regular well shuffled set of playing cards consisting of 52 cards (26 red and 26 black). What's the average length of a run of same-colored cards?
Ex: If the sequence of the first 10 cards are: R R R B R B B B B R the number is 10/5=2 since we have 5 sequences within the 10 cards, but what is the average for 52 cards.
For 4 cards (2 distinct red and 2 distinct black) we have the 24 combinations of the sequence and already here I find it confusing how to approach the problem. Any suggestions?
I guess I have to use the hypergeometric distribution to somehow compute the probability of drawing a sequence of a given length.
Thank you!
probability
 |Â
show 2 more comments
up vote
1
down vote
favorite
Suppose we have a regular well shuffled set of playing cards consisting of 52 cards (26 red and 26 black). What's the average length of a run of same-colored cards?
Ex: If the sequence of the first 10 cards are: R R R B R B B B B R the number is 10/5=2 since we have 5 sequences within the 10 cards, but what is the average for 52 cards.
For 4 cards (2 distinct red and 2 distinct black) we have the 24 combinations of the sequence and already here I find it confusing how to approach the problem. Any suggestions?
I guess I have to use the hypergeometric distribution to somehow compute the probability of drawing a sequence of a given length.
Thank you!
probability
Welcome to stackexchange. You are more likely to get answers rather than downvotes or votes to close if you edit the question to show us what you tried and where you are stuck. Can you answer the question for a deck of $2$ cards, or one of $4$ cards?
– Ethan Bolker
Jul 18 at 18:16
btw in your example why is it $10/5$ and not $10/4$, aren't there $4$ color changes in the sequence?
– gt6989b
Jul 18 at 18:19
I thought about this a well. But then I thought, that if I split the cards into on pile per sequence and computed the average number of cards in each pile 5 would make sense. However, since I made the problem my self I decided, that it is a minor detail to the problem since it will always be +-1 depending on the interpretation of the problem. Maybe I'm wrong.
– Mads Obdrup Jakobsen
Jul 18 at 18:30
1
The problem you describe by example seems to be "what's the average length of a run of same-colored cards"; the "number that must be drawn for the color to change" would (in English) typically mean "starting with the first card in the deck, you draw cards until you get one of a different color, and then compute the length of the same-color sequence before that color-change" (i.e., you're estimating the length of a single run of cards, starting at the first. Can you make clear which one of these you really want?
– John Hughes
Jul 18 at 18:44
2
For a large number of cards, the answer will be about $2$, in that about half the runs will be of length $1$, about half of the remainder of length $2$, about half of the rest of length $3$ and so on
– Henry
Jul 19 at 9:10
 |Â
show 2 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Suppose we have a regular well shuffled set of playing cards consisting of 52 cards (26 red and 26 black). What's the average length of a run of same-colored cards?
Ex: If the sequence of the first 10 cards are: R R R B R B B B B R the number is 10/5=2 since we have 5 sequences within the 10 cards, but what is the average for 52 cards.
For 4 cards (2 distinct red and 2 distinct black) we have the 24 combinations of the sequence and already here I find it confusing how to approach the problem. Any suggestions?
I guess I have to use the hypergeometric distribution to somehow compute the probability of drawing a sequence of a given length.
Thank you!
probability
Suppose we have a regular well shuffled set of playing cards consisting of 52 cards (26 red and 26 black). What's the average length of a run of same-colored cards?
Ex: If the sequence of the first 10 cards are: R R R B R B B B B R the number is 10/5=2 since we have 5 sequences within the 10 cards, but what is the average for 52 cards.
For 4 cards (2 distinct red and 2 distinct black) we have the 24 combinations of the sequence and already here I find it confusing how to approach the problem. Any suggestions?
I guess I have to use the hypergeometric distribution to somehow compute the probability of drawing a sequence of a given length.
Thank you!
probability
edited Jul 19 at 16:31
asked Jul 18 at 18:14


Mads Obdrup Jakobsen
62
62
Welcome to stackexchange. You are more likely to get answers rather than downvotes or votes to close if you edit the question to show us what you tried and where you are stuck. Can you answer the question for a deck of $2$ cards, or one of $4$ cards?
– Ethan Bolker
Jul 18 at 18:16
btw in your example why is it $10/5$ and not $10/4$, aren't there $4$ color changes in the sequence?
– gt6989b
Jul 18 at 18:19
I thought about this a well. But then I thought, that if I split the cards into on pile per sequence and computed the average number of cards in each pile 5 would make sense. However, since I made the problem my self I decided, that it is a minor detail to the problem since it will always be +-1 depending on the interpretation of the problem. Maybe I'm wrong.
– Mads Obdrup Jakobsen
Jul 18 at 18:30
1
The problem you describe by example seems to be "what's the average length of a run of same-colored cards"; the "number that must be drawn for the color to change" would (in English) typically mean "starting with the first card in the deck, you draw cards until you get one of a different color, and then compute the length of the same-color sequence before that color-change" (i.e., you're estimating the length of a single run of cards, starting at the first. Can you make clear which one of these you really want?
– John Hughes
Jul 18 at 18:44
2
For a large number of cards, the answer will be about $2$, in that about half the runs will be of length $1$, about half of the remainder of length $2$, about half of the rest of length $3$ and so on
– Henry
Jul 19 at 9:10
 |Â
show 2 more comments
Welcome to stackexchange. You are more likely to get answers rather than downvotes or votes to close if you edit the question to show us what you tried and where you are stuck. Can you answer the question for a deck of $2$ cards, or one of $4$ cards?
– Ethan Bolker
Jul 18 at 18:16
btw in your example why is it $10/5$ and not $10/4$, aren't there $4$ color changes in the sequence?
– gt6989b
Jul 18 at 18:19
I thought about this a well. But then I thought, that if I split the cards into on pile per sequence and computed the average number of cards in each pile 5 would make sense. However, since I made the problem my self I decided, that it is a minor detail to the problem since it will always be +-1 depending on the interpretation of the problem. Maybe I'm wrong.
– Mads Obdrup Jakobsen
Jul 18 at 18:30
1
The problem you describe by example seems to be "what's the average length of a run of same-colored cards"; the "number that must be drawn for the color to change" would (in English) typically mean "starting with the first card in the deck, you draw cards until you get one of a different color, and then compute the length of the same-color sequence before that color-change" (i.e., you're estimating the length of a single run of cards, starting at the first. Can you make clear which one of these you really want?
– John Hughes
Jul 18 at 18:44
2
For a large number of cards, the answer will be about $2$, in that about half the runs will be of length $1$, about half of the remainder of length $2$, about half of the rest of length $3$ and so on
– Henry
Jul 19 at 9:10
Welcome to stackexchange. You are more likely to get answers rather than downvotes or votes to close if you edit the question to show us what you tried and where you are stuck. Can you answer the question for a deck of $2$ cards, or one of $4$ cards?
– Ethan Bolker
Jul 18 at 18:16
Welcome to stackexchange. You are more likely to get answers rather than downvotes or votes to close if you edit the question to show us what you tried and where you are stuck. Can you answer the question for a deck of $2$ cards, or one of $4$ cards?
– Ethan Bolker
Jul 18 at 18:16
btw in your example why is it $10/5$ and not $10/4$, aren't there $4$ color changes in the sequence?
– gt6989b
Jul 18 at 18:19
btw in your example why is it $10/5$ and not $10/4$, aren't there $4$ color changes in the sequence?
– gt6989b
Jul 18 at 18:19
I thought about this a well. But then I thought, that if I split the cards into on pile per sequence and computed the average number of cards in each pile 5 would make sense. However, since I made the problem my self I decided, that it is a minor detail to the problem since it will always be +-1 depending on the interpretation of the problem. Maybe I'm wrong.
– Mads Obdrup Jakobsen
Jul 18 at 18:30
I thought about this a well. But then I thought, that if I split the cards into on pile per sequence and computed the average number of cards in each pile 5 would make sense. However, since I made the problem my self I decided, that it is a minor detail to the problem since it will always be +-1 depending on the interpretation of the problem. Maybe I'm wrong.
– Mads Obdrup Jakobsen
Jul 18 at 18:30
1
1
The problem you describe by example seems to be "what's the average length of a run of same-colored cards"; the "number that must be drawn for the color to change" would (in English) typically mean "starting with the first card in the deck, you draw cards until you get one of a different color, and then compute the length of the same-color sequence before that color-change" (i.e., you're estimating the length of a single run of cards, starting at the first. Can you make clear which one of these you really want?
– John Hughes
Jul 18 at 18:44
The problem you describe by example seems to be "what's the average length of a run of same-colored cards"; the "number that must be drawn for the color to change" would (in English) typically mean "starting with the first card in the deck, you draw cards until you get one of a different color, and then compute the length of the same-color sequence before that color-change" (i.e., you're estimating the length of a single run of cards, starting at the first. Can you make clear which one of these you really want?
– John Hughes
Jul 18 at 18:44
2
2
For a large number of cards, the answer will be about $2$, in that about half the runs will be of length $1$, about half of the remainder of length $2$, about half of the rest of length $3$ and so on
– Henry
Jul 19 at 9:10
For a large number of cards, the answer will be about $2$, in that about half the runs will be of length $1$, about half of the remainder of length $2$, about half of the rest of length $3$ and so on
– Henry
Jul 19 at 9:10
 |Â
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
2
down vote
This is about the average length of runs in binary words of length $2n$ having exactly $n$ zeros and $n$ ones. The total number of admissible words is given by $A_n=2nchoose n$, and the numbers $a_k$ of admissible words with exactly $k$ runs are given by
$$eqaligna_2r&=2n-1choose r-1^2qquadqquadquad(1leq rleq n) ,cr
a_2r+1&=2n-1choose rn-1choose r-1qquad(1leq rleq n-1) .cr$$
(For the first line we can choose to begin with a $0$ or a $1$. Then we have to put $r-1$ separators in the $n-1$ spaces between $n$ stars; this separately for the zeros and the ones. The second line is explained similarly.)
The expected length $E(n)$ of the observed runs is then given by
$$E(n)=2nover A_nleft(sum_r=1^n a_2rover 2r+sum_r=1^n-1a_2r+1over 2r+1right) .$$
The following figure shows a plot of the resulting values. As expected one has $lim_ntoinftyE(n)=2$. In particular $E(26)=1.96151$.
Interesting, the remaining difference from $2$ is a lot greater than I'd expected.
– joriki
Jul 19 at 12:27
Is your chart $x$-axis for the total number of cards and your $E(26)$ for half the total?
– Henry
Jul 19 at 15:52
@Henry: Sorry. The input was $tt ListPlot[Table[2 n, erw[n], n, 2, 20]]$, where $tt erw[n]$ stands for $E(n)$.
– Christian Blatter
Jul 19 at 18:56
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
This is about the average length of runs in binary words of length $2n$ having exactly $n$ zeros and $n$ ones. The total number of admissible words is given by $A_n=2nchoose n$, and the numbers $a_k$ of admissible words with exactly $k$ runs are given by
$$eqaligna_2r&=2n-1choose r-1^2qquadqquadquad(1leq rleq n) ,cr
a_2r+1&=2n-1choose rn-1choose r-1qquad(1leq rleq n-1) .cr$$
(For the first line we can choose to begin with a $0$ or a $1$. Then we have to put $r-1$ separators in the $n-1$ spaces between $n$ stars; this separately for the zeros and the ones. The second line is explained similarly.)
The expected length $E(n)$ of the observed runs is then given by
$$E(n)=2nover A_nleft(sum_r=1^n a_2rover 2r+sum_r=1^n-1a_2r+1over 2r+1right) .$$
The following figure shows a plot of the resulting values. As expected one has $lim_ntoinftyE(n)=2$. In particular $E(26)=1.96151$.
Interesting, the remaining difference from $2$ is a lot greater than I'd expected.
– joriki
Jul 19 at 12:27
Is your chart $x$-axis for the total number of cards and your $E(26)$ for half the total?
– Henry
Jul 19 at 15:52
@Henry: Sorry. The input was $tt ListPlot[Table[2 n, erw[n], n, 2, 20]]$, where $tt erw[n]$ stands for $E(n)$.
– Christian Blatter
Jul 19 at 18:56
add a comment |Â
up vote
2
down vote
This is about the average length of runs in binary words of length $2n$ having exactly $n$ zeros and $n$ ones. The total number of admissible words is given by $A_n=2nchoose n$, and the numbers $a_k$ of admissible words with exactly $k$ runs are given by
$$eqaligna_2r&=2n-1choose r-1^2qquadqquadquad(1leq rleq n) ,cr
a_2r+1&=2n-1choose rn-1choose r-1qquad(1leq rleq n-1) .cr$$
(For the first line we can choose to begin with a $0$ or a $1$. Then we have to put $r-1$ separators in the $n-1$ spaces between $n$ stars; this separately for the zeros and the ones. The second line is explained similarly.)
The expected length $E(n)$ of the observed runs is then given by
$$E(n)=2nover A_nleft(sum_r=1^n a_2rover 2r+sum_r=1^n-1a_2r+1over 2r+1right) .$$
The following figure shows a plot of the resulting values. As expected one has $lim_ntoinftyE(n)=2$. In particular $E(26)=1.96151$.
Interesting, the remaining difference from $2$ is a lot greater than I'd expected.
– joriki
Jul 19 at 12:27
Is your chart $x$-axis for the total number of cards and your $E(26)$ for half the total?
– Henry
Jul 19 at 15:52
@Henry: Sorry. The input was $tt ListPlot[Table[2 n, erw[n], n, 2, 20]]$, where $tt erw[n]$ stands for $E(n)$.
– Christian Blatter
Jul 19 at 18:56
add a comment |Â
up vote
2
down vote
up vote
2
down vote
This is about the average length of runs in binary words of length $2n$ having exactly $n$ zeros and $n$ ones. The total number of admissible words is given by $A_n=2nchoose n$, and the numbers $a_k$ of admissible words with exactly $k$ runs are given by
$$eqaligna_2r&=2n-1choose r-1^2qquadqquadquad(1leq rleq n) ,cr
a_2r+1&=2n-1choose rn-1choose r-1qquad(1leq rleq n-1) .cr$$
(For the first line we can choose to begin with a $0$ or a $1$. Then we have to put $r-1$ separators in the $n-1$ spaces between $n$ stars; this separately for the zeros and the ones. The second line is explained similarly.)
The expected length $E(n)$ of the observed runs is then given by
$$E(n)=2nover A_nleft(sum_r=1^n a_2rover 2r+sum_r=1^n-1a_2r+1over 2r+1right) .$$
The following figure shows a plot of the resulting values. As expected one has $lim_ntoinftyE(n)=2$. In particular $E(26)=1.96151$.
This is about the average length of runs in binary words of length $2n$ having exactly $n$ zeros and $n$ ones. The total number of admissible words is given by $A_n=2nchoose n$, and the numbers $a_k$ of admissible words with exactly $k$ runs are given by
$$eqaligna_2r&=2n-1choose r-1^2qquadqquadquad(1leq rleq n) ,cr
a_2r+1&=2n-1choose rn-1choose r-1qquad(1leq rleq n-1) .cr$$
(For the first line we can choose to begin with a $0$ or a $1$. Then we have to put $r-1$ separators in the $n-1$ spaces between $n$ stars; this separately for the zeros and the ones. The second line is explained similarly.)
The expected length $E(n)$ of the observed runs is then given by
$$E(n)=2nover A_nleft(sum_r=1^n a_2rover 2r+sum_r=1^n-1a_2r+1over 2r+1right) .$$
The following figure shows a plot of the resulting values. As expected one has $lim_ntoinftyE(n)=2$. In particular $E(26)=1.96151$.
edited Jul 19 at 12:29
answered Jul 19 at 12:23


Christian Blatter
164k7107306
164k7107306
Interesting, the remaining difference from $2$ is a lot greater than I'd expected.
– joriki
Jul 19 at 12:27
Is your chart $x$-axis for the total number of cards and your $E(26)$ for half the total?
– Henry
Jul 19 at 15:52
@Henry: Sorry. The input was $tt ListPlot[Table[2 n, erw[n], n, 2, 20]]$, where $tt erw[n]$ stands for $E(n)$.
– Christian Blatter
Jul 19 at 18:56
add a comment |Â
Interesting, the remaining difference from $2$ is a lot greater than I'd expected.
– joriki
Jul 19 at 12:27
Is your chart $x$-axis for the total number of cards and your $E(26)$ for half the total?
– Henry
Jul 19 at 15:52
@Henry: Sorry. The input was $tt ListPlot[Table[2 n, erw[n], n, 2, 20]]$, where $tt erw[n]$ stands for $E(n)$.
– Christian Blatter
Jul 19 at 18:56
Interesting, the remaining difference from $2$ is a lot greater than I'd expected.
– joriki
Jul 19 at 12:27
Interesting, the remaining difference from $2$ is a lot greater than I'd expected.
– joriki
Jul 19 at 12:27
Is your chart $x$-axis for the total number of cards and your $E(26)$ for half the total?
– Henry
Jul 19 at 15:52
Is your chart $x$-axis for the total number of cards and your $E(26)$ for half the total?
– Henry
Jul 19 at 15:52
@Henry: Sorry. The input was $tt ListPlot[Table[2 n, erw[n], n, 2, 20]]$, where $tt erw[n]$ stands for $E(n)$.
– Christian Blatter
Jul 19 at 18:56
@Henry: Sorry. The input was $tt ListPlot[Table[2 n, erw[n], n, 2, 20]]$, where $tt erw[n]$ stands for $E(n)$.
– Christian Blatter
Jul 19 at 18:56
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2855854%2fdistance-between-color-change-in-playing-cards%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Welcome to stackexchange. You are more likely to get answers rather than downvotes or votes to close if you edit the question to show us what you tried and where you are stuck. Can you answer the question for a deck of $2$ cards, or one of $4$ cards?
– Ethan Bolker
Jul 18 at 18:16
btw in your example why is it $10/5$ and not $10/4$, aren't there $4$ color changes in the sequence?
– gt6989b
Jul 18 at 18:19
I thought about this a well. But then I thought, that if I split the cards into on pile per sequence and computed the average number of cards in each pile 5 would make sense. However, since I made the problem my self I decided, that it is a minor detail to the problem since it will always be +-1 depending on the interpretation of the problem. Maybe I'm wrong.
– Mads Obdrup Jakobsen
Jul 18 at 18:30
1
The problem you describe by example seems to be "what's the average length of a run of same-colored cards"; the "number that must be drawn for the color to change" would (in English) typically mean "starting with the first card in the deck, you draw cards until you get one of a different color, and then compute the length of the same-color sequence before that color-change" (i.e., you're estimating the length of a single run of cards, starting at the first. Can you make clear which one of these you really want?
– John Hughes
Jul 18 at 18:44
2
For a large number of cards, the answer will be about $2$, in that about half the runs will be of length $1$, about half of the remainder of length $2$, about half of the rest of length $3$ and so on
– Henry
Jul 19 at 9:10