# Probability that a deck of cards is tampered

**URL:** <https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559>\
**Category:** Factual Questions\
**Created:** [July 15, 2021, 1:30pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559 "2021-07-15T13:30:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![am77494](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@am77494](https://boards.straightdope.com/u/am77494)\
**Post date:** [July 15, 2021, 1:30pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/1 "2021-07-15T13:30:41Z")

</div>

Suppose I have a deck of cards that is tampered by removing one red card and replacing it with a black card from another deck.

So we have 25 red cards and 27 black cards. Now the deck is well shuffled and one card is drawn at a time.

Obviously the 52nd draw will conclusively prove that the deck has more black cards. But looking at the nth draw( n\<52) , can you give a probability that the deck is tampered ?

---

<div class="post-metadata">

**Author:** ![Limmin](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Limmin](https://boards.straightdope.com/u/Limmin)\
**Post date:** [July 15, 2021, 1:48pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/2 "2021-07-15T13:48:34Z")

</div>

Is this a homework question? Not to give too much away, I’d compare the normal case (26 black, 26 red) probabilities after n cards have been drawn, with the tampered case (25 red, 27 black).

Both will be cases of taking a sample out of the pool without replacement, so the probabilities change. The expressions will be a little bit different.

---

<div class="post-metadata">

**Author:** ![am77494](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@am77494](https://boards.straightdope.com/u/am77494)\
**Post date:** [July 15, 2021, 1:55pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/3 "2021-07-15T13:55:20Z")

</div>

> [@Limmin](#):
>
> Is this a homework question?

Not a home work question. I’d like to apply the results to climate change, but that is a different post.

No sample taking is allowed. Only one card is drawn from the deck and discarded.

---

<div class="post-metadata">

**Author:** ![Kron](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/kron/32/12444_2.png) [@Kron](https://boards.straightdope.com/u/Kron)\
**Post date:** [July 15, 2021, 1:55pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/4 "2021-07-15T13:55:36Z")

</div>

Assuming we are talking standard playing cards, you are looking for the probability of having drawn the second copy of whatever was subbed in; say, the second ace of spades that replaced the ace of hearts.

---

<div class="post-metadata">

**Author:** ![am77494](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@am77494](https://boards.straightdope.com/u/am77494)\
**Post date:** [July 15, 2021, 2:01pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/5 "2021-07-15T14:01:40Z")

</div>

@Kron - thanks for pointing that out. Thats not what I am looking for though.

I am looking for just the colors.

---

<div class="post-metadata">

**Author:** ![Limmin](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Limmin](https://boards.straightdope.com/u/Limmin)\
**Post date:** [July 15, 2021, 2:05pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/6 "2021-07-15T14:05:45Z")

</div>

Isn’t @am77494 looking for just the probability the card will be black or red, given the tampered case?

If this is the case and we’re only interested in the probability based on the first card, this should be a lot simpler. In the unaltered case the probability of drawing a black card is 26/52 or 0.5. In the altered case, the probability of drawing a black card is 27/52 or 0.5192.

However, having drawn a black card, there’s no way to tell if the deck had been tampered with. Wasn’t that what you were after?

---

<div class="post-metadata">

**Author:** ![am77494](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@am77494](https://boards.straightdope.com/u/am77494)\
**Post date:** [July 15, 2021, 2:06pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/7 "2021-07-15T14:06:28Z")

</div>

> [@Limmin](#):
>
> However, having drawn a black card, there’s no way to tell if the deck had been tampered with. Wasn’t that what you were after?

Yes - thank you

---

<div class="post-metadata">

**Author:** ![Limmin](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Limmin](https://boards.straightdope.com/u/Limmin)\
**Post date:** [July 15, 2021, 2:08pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/8 "2021-07-15T14:08:01Z")

</div>

This sort of probability is definitely doable, I just don’t recall the method.  
I am sure others will supply this info real soon 😉

---

<div class="post-metadata">

**Author:** ![DMC](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dmc/32/18049_2.png) [@DMC](https://boards.straightdope.com/u/DMC)\
**Post date:** [July 15, 2021, 2:16pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/9 "2021-07-15T14:16:28Z")

</div>

If you have 52 cards, 25 are red, 27 are black, nothing else identifying about them other than color, you won’t know that it’s been tampered with until you draw the 27th black card. So you’re really asking for the odds that the nth draw exposes the 27th black card, unless I’m missing something.

---

<div class="post-metadata">

**Author:** ![FlikTheBlue](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/fliktheblue/32/10972_2.png) [@FlikTheBlue](https://boards.straightdope.com/u/FlikTheBlue)\
**Post date:** [July 15, 2021, 2:16pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/10 "2021-07-15T14:16:30Z")

</div>

I don’t know how to set up the calculations, but my guess is that whatever they are, they would have to be run twice. Since you’re asking about probability, rather than a definitive answer, a comparison would have to be made to the deck that hasn’t been tampered. Drawing just a few cards wouldn’t prove the non-tampered deck is fair, and there would, presumably, be some probability higher than zero that it might be tampered, even though it would turn out at the end that it wasn’t.

---

<div class="post-metadata">

**Author:** ![naita](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/naita/32/5862_2.png) [@naita](https://boards.straightdope.com/u/naita)\
**Post date:** [July 15, 2021, 2:50pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/11 "2021-07-15T14:50:03Z")

</div>

What you are looking for is P(T|R,B), the probability that the deck has been tampered with, given that you have drawn R red cards and B black cards. And we’re only looking at tampering by swapping one red card for a black, yes?

In Bayes’ theorem, which is usually used for conditional probabilities, we need P(T), which we don’t have. I’m trying to think of a way to find this probability using a simulation, but I’m having a hard time coming up with one.

---

<div class="post-metadata">

**Author:** ![naita](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/naita/32/5862_2.png) [@naita](https://boards.straightdope.com/u/naita)\
**Post date:** [July 15, 2021, 2:55pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/12 "2021-07-15T14:55:30Z")

</div>

> [@am77494](#):
>
> Not a home work question. I’d like to apply the results to climate change, but that is a different post.

I know you said it’s a topic for a different post, but this experiment, without replacement, would not be relevant to any natural phenomenon, except one with a finite set of predetermined outcomes you were drawing from without replacement.

---

<div class="post-metadata">

**Author:** ![filmore](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@filmore](https://boards.straightdope.com/u/filmore)\
**Post date:** [July 15, 2021, 3:01pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/13 "2021-07-15T15:01:06Z")

</div>

> [@DMC](#):
>
> If you have 52 cards, 25 are red, 27 are black, nothing else identifying about them other than color, you won’t know that it’s been tampered with until you draw the 27th black card. So you’re really asking for the odds that the nth draw exposes the 27th black card, unless I’m missing something.

We may not be able to tell which red card was removed until the end, but the black card now has a dup in the tampered deck. If you find that dup (e.g. see two ace of spades), then you know the deck was tampered with. Theoretically that could happen with the first two cards you flip over.

---

<div class="post-metadata">

**Author:** ![DMC](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dmc/32/18049_2.png) [@DMC](https://boards.straightdope.com/u/DMC)\
**Post date:** [July 15, 2021, 3:02pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/14 "2021-07-15T15:02:58Z")

</div>

> [@filmore](#):
>
> We may not be able to tell which red card was removed until the end, but the black card now has a dup in the tampered deck.

Based on [post 5](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/5), I’m assuming cards with colors, no face values. It’s possible that I misunderstood that post, so I’ll let @am77494 chime in.

---

<div class="post-metadata">

**Author:** ![naita](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/naita/32/5862_2.png) [@naita](https://boards.straightdope.com/u/naita)\
**Post date:** [July 15, 2021, 3:09pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/15 "2021-07-15T15:09:10Z")

</div>

> [@DMC](#):
>
> If you have 52 cards, 25 are red, 27 are black, nothing else identifying about them other than color, you won’t know that it’s been tampered with until you draw the 27th black card. So you’re really asking for the odds that the nth draw exposes the 27th black card, unless I’m missing something.

This is, indirectly, the right answer. (I mean indirectly in that he wasn’t literally asking for the odds that the nth draw exposes the 27th black card.)

Think about it this way, OP. Say you draw 25 red cards and 26 black. This has a probability of 50% if the deck is fair. If the deck has been tampered with the probability is 26%. Neither of those are small enough to give you statistical power to make a valid guess as to whether the deck is fair or not. You’d have to repeat the process over and over with the same deck and look at the distributions over time, but if you could do that you could also just draw one more card.

And if you try to make a determination after having drawn fewer cards, it’s even worse.

---

<div class="post-metadata">

**Author:** ![am77494](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@am77494](https://boards.straightdope.com/u/am77494)\
**Post date:** [July 15, 2021, 3:09pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/16 "2021-07-15T15:09:12Z")

</div>

> [@naita](#):
>
> What you are looking for is P(T|R,B), the probability that the deck has been tampered with, given that you have drawn R red cards and B black cards. And we’re only looking at tampering by swapping one red card for a black, yes?

thank you Naita. That is precisely stated.

> [@naita](#):
>
> I know you said it’s a topic for a different post, but this experiment, without replacement, would not be relevant to any natural phenomenon, except one with a finite set of predetermined outcomes you were drawing from without replacement.

@naita - not disagreeing with you. Digressing here, But say I have 30 cards in a deck, each card represents a year, a black card represents a warm year and a red card represents a cold year.

30 years, or 30 cards, represents climate.

For example sakes, a non global warmed deck will have equal black and red cards (not strictly true but lets assume) and a **global warmed deck** will have 16 blacks and 14 reds.

The contention was that as each card is drawn (a year passes), you cannot tell by this data alone, if the deck is global warming deck or not. Not trying to deny global warming (please). And I completely understand the other data supporting global warming.

Now can we please go back to the question ?

---

<div class="post-metadata">

**Author:** ![naita](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/naita/32/5862_2.png) [@naita](https://boards.straightdope.com/u/naita)\
**Post date:** [July 15, 2021, 3:11pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/17 "2021-07-15T15:11:05Z")

</div>

> [@am77494](#):
>
> For example sakes, a non global warmed deck will have equal black and red cards (not strictly true but lets assume) and a **global warmed deck** will have 16 blacks and 14 reds.

My point is that natural phenomena always put the drawn card back in the deck. Which makes it a totally different statistical problem.

---

<div class="post-metadata">

**Author:** ![k9bfriender](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/k9bfriender/32/3283_2.png) [@k9bfriender](https://boards.straightdope.com/u/k9bfriender)\
**Post date:** [July 15, 2021, 3:45pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/18 "2021-07-15T15:45:05Z")

</div>

Yeah, it seems as both the deck question and the climate analogy work better _with_ replacement than with discarding.

Have a deck of 50 cards, 25 red, 25 black. You always have a 50% chance of drawing one or the other.

If you replace one, so you have 24 red, 26 black, you have a 48/52% chance respectively. At that point, a valid question can be asked as to how many cards do you need to draw to start seeing statistical significance that indicates a high probability of unequal decks.

---

<div class="post-metadata">

**Author:** ![CardboardBoxx](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cardboardboxx/32/7079_2.png) [@CardboardBoxx](https://boards.straightdope.com/u/CardboardBoxx)\
**Post date:** [July 15, 2021, 4:01pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/19 "2021-07-15T16:01:58Z")

</div>

> [@naita](#):
>
> Think about it this way, OP. Say you draw 25 red cards and 26 black. This has a probability of 50% if the deck is fair. **If the deck has been tampered with the probability is 26%**

Surely it’s a 51.9% chance, as if the bottom card is black, you will always get to 25R 26B.

---

<div class="post-metadata">

**Author:** ![naita](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/naita/32/5862_2.png) [@naita](https://boards.straightdope.com/u/naita)\
**Post date:** [July 15, 2021, 4:09pm UTC](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559/20 "2021-07-15T16:09:57Z")

</div>

> [@CardboardBoxx](#):
>
> Surely it’s a 51.9% chance, as if the bottom card is black, you will always get to 25R 26B.

Yes, I put a sample size of 50 into the calculator by mistake. D’oh! It should be 50% and 51.9%.

[Next page](https://boards.straightdope.com/t/probability-that-a-deck-of-cards-is-tampered/946559.md?page=2)
