Solved – Probability of a card being higher than a random card

probability

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!

Best 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)[1]]
    }
    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