The Magic Café
Username:
Password:
[ Lost Password ]
  [ Forgot Username ]
The Magic Cafe Forum Index » » Magical equations » » Probability of at least one pair (0 Likes) Printer Friendly Version

Larry Barnowsky
View Profile
Inner circle
Cooperstown, NY where bats are made from
4770 Posts

Profile of Larry Barnowsky
From a shuffled deck, what is the probability that you will find at least two cards in a row that have the same numerical value? That is, at least two adjacent cards sharing the same value.

Larry
Larry Barnowsky
View Profile
Inner circle
Cooperstown, NY where bats are made from
4770 Posts

Profile of Larry Barnowsky
Just to make things clearer for example either of the following would meet my criteria:
XXXXX77XXXXXXX...
XXXX55XXXX88...
XXXXX666XXXXXXX...
XXXX22XXXXQQXXXXXKK...

If you don't have an exact answer from a formula, a computer simulation would suffice
BTW, this was also discussed at http://www.themagiccafe.com/forums/viewt......forum=99 but a precise percentage was not calculated.
Larry
Scott Cram
View Profile
Inner circle
2678 Posts

Profile of Scott Cram
I queried Wolfram|Alpha with "probability pair 2-card hand", and it gave the reply that the odds of that were roughly 1 in 17 (.05882..., or about 5.882%).

That, however, is the odds of being dealt a pair given a single 2-card hand from a shuffled deck of 52.

If we spread out a shuffled deck face-up, we effectively have 51 two-card hands staring us in the face (assuming we don't pair the bottom card with the top card).

The probability of a pair NOT happening in 51 hands should be about (16/17)^51, or about 4.54%.

Subtracting that from 1 to get the proba......ccurring, then, would be about 95.46%.

As always, probability is an easy thing to screw up, so if my approach is wrong, please let me know, and explain my error and then give the correct procedure.

One possible error in the above calculation I can already see is that it doesn't diminish as the cards progress. If the top card were a 4, and the next card were a 6, that reduces the likelihood of a pair of 4s and 6s later on in the deck, and thus affects the later possibilities.

It's probably best to consider my 95.46% calculation as a quick back-of-the-envelope estimate.

------------------
Another way to consider this:

Hmmm...considering that the top card can be any card, the next card can only form a pair with any of 3 other cards. The second card can only be 1 of 51 cards, and if it's any of 48 cards, a pair won't be formed.

By that measure, the odds of the next card NOT forming a pair are 48/51 (or 16/17 from above). For the third card, the odds should be 47/50, and so on. So the probability of no pair showing up in the deck should be 48!/51! (48 factorial divided by 51 factorial).

So the probability of a pair showing up should be 1-(48!/51!), or about 99.99%!

Either way, it seems at least 1 pair is VERY likely in the spread!
owen.daniel
View Profile
Inner circle
England
1048 Posts

Profile of owen.daniel
Not an exact solution yet, but...

The approach I would take is to look up some information about (mathematical) necklaces: a necklace in mathematical terms is very similar to a real necklace that has many beads on it: it is a cycle of objects which are all kept in the same order, but has no beginning or end. So it is a cyclic ordering of the objects.

Upto cutting, a pack of cards is also a cyclic ordering of objects. Consider the following 'necklace': for each value A,2,...,K you have four beads with that symbol, so in total you have 52 beads of 13 different types. Your question is what the probability is that twobeads of the same type are next to each other. Maths minded people should quickly find a solution to this sort of problem if they turn to some decent combinatorics books. I'm currently away from my university otherwise I'd have turned to the books myself.

Perhaps I will get round to it in the coming days.

Owen
maratekin
View Profile
Regular user
150 Posts

Profile of maratekin
I've written an Excel-based simulation (using VB to automate the number of iterations); this is suggesting that the probability is roughly 95-96%. If you'd like to get a copy of the simulation, please PM me. It also calculates the probability of the same card being in the same position within two shuffled decks (which the simulation is calculating at 62-63%).

Mark
TomasB
View Profile
Inner circle
Sweden
1150 Posts

Profile of TomasB
Here are some results from 10 million simulations, where three adjacent counts as two pairs, and four adjacent counts as three pairs.

The frequencies of 1 through 11 pairs are

1: 0.1447
2: 0.2263
3: 0.2309
4: 0.1731
5: 0.1017
6: 0.0487
7: 0.0195
8: 0.0067
9: 0.0020
10: 0.0005
11: 0.0001

For the main result, you'll have at least one pair 95.5% of the time.

Over a third of the time you will have at least 4 pairs, and almost 60% of the time you'll have at least 3 pairs.

On an average there are 3.00 pairs in the deck. Three pairs is also the most likely result.


For fun I did the same simulation with triplets instead of pairs. I'm surprised that the probability of at least three of the same value in the row is only 11%. I thought it'd be higher.


Just as a curiosity for the bar betters out there: If you only deal (or randomly remove) 13 cards you have a 52% probability of getting at least one adjacent pair. More cards of course raises the probability until you reach

/Tomas
TomasB
View Profile
Inner circle
Sweden
1150 Posts

Profile of TomasB
Ooops, accidentallty cut that off. The last sentence should of course end "until you reach 95.5% for dealing the whole deck."

/Tomas
Larry Barnowsky
View Profile
Inner circle
Cooperstown, NY where bats are made from
4770 Posts

Profile of Larry Barnowsky
Tomas,

Tack så mycket for the simulation results and thanks to Mark, Owen, and Scott for their analysis.

Larry Smile
owen.daniel
View Profile
Inner circle
England
1048 Posts

Profile of owen.daniel
Hi all.

So in the time since my post I have been thinking some more about this; the news is not good.

Whilst my formulation was correct, it can be described in many similar and perhaps simpler forms. Certainly no real reason to look at necklaces. An equivalent formulation is the following: How many ways are there to partition the integers [52] = 1,2,...,52 into 13 sets each containing 4 numbers so that no two consecutive numbers are in the same block of the partition.

Many people will have heard of the so called 'Mississippi problem' which asks how many ways there are to order the letters M I S S I S S I P P I so that there is at least one consecutive pair [there is a related high school maths problem which asks how many rearrangements of those letters do not contain a consecutive pair of Ss, this is much easier]. This problem requires some work to solve, and the problem that you (Larry) want to solve is equivalent to this, but with a lot more elements to rearrange. If you're interested there is a paper titled 'The Mississippi problem' by Blom, Englund, Sandell.

The only thing that makes life a little easier is the fact that we have an equal number of cards of each variety (i.e. there are 4 of each value)... this is not the case in the Mississippi problem where we have 4 I's, 4 S's, 2 P's, and only 1 M.

I tried a series of approaches using brute combinatorial logic, recursion relations, and probability methods... but none really got me anywhere.

I'd be really interested to know if somebody does have a solution to this, but on the face of it I have come to believe that this is in fact a very difficult problem... though there's still reasonable doubt that I'm just overlooking something.

So, in the mean time (though I'm reluctant to say it), it looks like the simulations will have to do.

Best

Owen

PS. Just from looking at the numbers that you posted Tomas, it looks like we're dealing with a discrete beta distribution... Knowing that might help to actually work out the correct probabilities... Just a thought.
owen.daniel
View Profile
Inner circle
England
1048 Posts

Profile of owen.daniel
I've just been playing around a bit, and the data given by Tomas does fit very closely to a beta binomial distribution with parameters a = 120, b = 1320, n = 36...
The Magic Cafe Forum Index » » Magical equations » » Probability of at least one pair (0 Likes)
[ Top of Page ]
All content & postings Copyright © 2001-2025 Steve Brooks. All Rights Reserved.
This page was created in 0.04 seconds requiring 5 database queries.
The views and comments expressed on The Magic Café
are not necessarily those of The Magic Café, Steve Brooks, or Steve Brooks Magic.
> Privacy Statement <

ROTFL Billions and billions served! ROTFL