# Probability of a card being higher than a random card

Say you have a game that asks you whether you think the next card will be higher. In this game ace is 1. If the next card is equal to the first one then another random card is taken until the next card is either higher or lower. Suits are disregarded in this game. One deck is used and cards are recycled.

What is the probability of the next card being higher than the previous one. I have thought up this equation but not sure if it is correct:

$$probability = \frac{13 - Rank}{12} * 100%$$

Where Rank is the rank of the current card (from 1 to 13)

Therefore if Rank = Ace, probability = 100% Is this equation correct? Thanks!

• I think that this should be correct. if you want to be sure I suggest you to run some simulation to estimate the probability – Donbeo May 4 '14 at 20:40
• This is a conditional probability (given the rank of the previous card, you can work out the probability), but your question originally sounds like it's after the unconditional probability (you don't know the rank yet, you're trying to work out the probability the second card is larger than the first without seeing either). Is that the case? – Glen_b May 4 '14 at 20:42
• Is this a standard deck of 52 cards? Do you return a card to the deck after you have taken it? If so, where in the deck do you put it? – Joel Reyes Noche May 5 '14 at 7:18
• @JoelReyesNoche Yes it's 52 cards, the card goes to the bottom of the pile. I've edited the post – Cobbles May 5 '14 at 8:17
• If after each card is taken it is put on the bottom of the pile, and if you remember which cards have already been taken, then the probabilities change each time you take a card. To avoid this, you might want to put back the cards in random locations in the deck each time. – Joel Reyes Noche May 5 '14 at 13:14

## 1 Answer

This program simulate you game

sim=1000000
prob=matrix(data=0,nrow=13,ncol=1)
for(x in 1:13)
{
print(x)
for(iter in 1:sim)
{

#print(paste(iter/sim,x,sep="   "))
cards=1:13
cards=c(cards,cards,cards,cards,cards,cards,cards,cards,cards,cards,cards)# suppose to use more than one deck
cards=cards[-x]
y=-1
while(T)
{
y=sample(x=cards,size=1)
if(y!=x)
break

cards=cards[-which(cards==y)]
}
if(x<y)
prob[x]=prob[x]+1
}
}

prob=prob/sim

rank=1:13

formula=(13-rank)/12 # your formula
#prob=vector(prob)

formula-prob #error between the estimated probability and your formula

formula-prob
[,1]
[1,]  0.000000e+00
[2,]  1.516667e-04
[3,]  8.533333e-05
[4,]  3.830000e-04
[5,]  7.036667e-04
[6,]  8.143333e-04
[7,]  1.070000e-04
[8,] -1.005333e-03
[9,]  7.083333e-04
[10,] -5.590000e-04
[11,]  3.986667e-04
[12,]  3.003333e-04
[13,]  0.000000e+00
>


The error is small so your formula it's probably right