Queen

For fans of all other kinds of logic puzzles

Queen

Postby m_b_metcalf » Sat Jan 29, 2022 10:30 am

1. Shuffle a deck of cards.

2. Turn over as many cards as necessary to find the first queen.

3. Record that number.

4. Repeat from 1., many times.

Q. What is the average value of the recorded numbers?

Mike
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13631
Joined: 15 May 2006
Location: Berlin

Re: Queen

Postby Mathimagics » Sat Jan 29, 2022 11:54 am

Is it ~10.5 ... :?:
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: Queen

Postby m_b_metcalf » Sat Jan 29, 2022 1:26 pm

Mathimagics wrote:Is it ~10.5 ... :?:

Writing a little prgram, to cheat, tells me that the answer is (number_of_cards + 1)/(number_of_queens + 1) = 10 3/5. Now to find the proof...
User avatar
m_b_metcalf
2017 Supporter
 
Posts: 13631
Joined: 15 May 2006
Location: Berlin

Re: Queen

Postby Mathimagics » Sat Jan 29, 2022 2:27 pm

10.6 is indeed correct!

Proof uses probability P(N) that a queen turns up on turn N, but not before. Expected value = Sum(P(N) * N) [N=1 to 49]

This probably reduces to the simple expression that you gave ...
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: Queen

Postby Mathimagics » Sun Jan 30, 2022 11:26 am

Values of P(n) for n = 1 to 5:

Code: Select all
  4
 --
 52

 48    4
 -- X --
 52   51

 48   47    4
 -- X -- X --
 52   51   50

 48   47   46    4
 -- X -- X -- X --
 52   51   50   49

 48   47   46   45    4
 -- X -- X -- X -- X --
 52   51   50   49   48

Note that P(n) = 4 / (53-N) * [1 - P(N-1)]

Now Sum(n * P(n)) gives 53 / 5. Why is this so?

Perhaps a simple explanation will suffice. The "average distribution" for a deck of C cards, containing Q queens, has the queens evenly placed, with the remaining (C - Q) cards distributed into (Q + 1) sets.

So the number of cards before the first queen is (C - Q) / (Q + 1), and thus the first queen occurs at 1 + (C - Q) / (Q + 1) = (C + 1) / (Q + 1).
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: Queen

Postby StrmCkr » Sun Jan 30, 2022 11:41 am

Pn = ( (N +1)/ (k+1))

Where n is the number of cards in a deck and k is the number of target cards

53/5 = 10.6

Proof any of n cards is the target
Then Pn = 53/53 =1

We also know there is n-k non target cards in a deck
In which one of each non target card could arrive before the target card each contributing 1/(k+1) probability

Where by the odds of not getting any target card + the odds of any target being true
Is the formula for the odds of nth cards arriving before the first of k target cards.
((N-k) / (k+1)) +1 => ((N-k)+(k+1)) /(k+1) => {n+1} / {k+1}
Edit:
I see you posted the same thing I was working on magic
this is a fun problem i first saw it in university for one of my stats class finals.
Some do, some teach, the rest look it up.
stormdoku
User avatar
StrmCkr
 
Posts: 1432
Joined: 05 September 2006


Return to Other logic puzzles