WOO logo

Ask The Wizard #283

What is a Fisher-Yates shuffle?

anonymous

The Fisher-Yates shuffle is an efficient algorithm used to randomly rearrange the elements in an array without bias. Start by determining the total number of items, denoted as n.

  1. Randomly select a card from numbers ranging from 1 to n-1.
  2. Swap that card with card number n.
  3. Subtract 1 from n.
  4. Repeat steps 1 to 3 until n=2.

Here’s how this method is implemented in C++. This example is simplified and does not consider modulo bias.

void fisher_yates(int deck[], int NumCards) { }
{
int i,hold;
unsigned int rn;
for (i=NumCards-1; i>0; i--)
{
rn=genrand_int32()%(i+1);
hold=deck[rn];
deck[rn]=deck[i];
deck[i]=hold;
}
}


This topic is elaborated upon in my discussion forum at Wizard of Vegas .

At the Lake Elsinore Hotel and Casino in California, there is a unique blackjack side bet known as the Red Flex. This bet pays out based on the sequence of red cards dealt to the dealer, beginning with the dealer's first card. The payout structure is as follows:

  • Seven or more reds pays 200 to 1
  • Six reds pays 100 to 1
  • Five reds pays 50 to 1
  • Four reds pays 10 to 1
  • Three reds pays 5 to 1
  • Two reds pays 1 to 1

Even if the dealer busts or isn't required to draw additional cards because all players have busted, the dealer will still draw as necessary to settle the side bet.

What are the odds?

anonymous

I present my findings on the Red Flex in my blackjack appendix 8 .

This topic is elaborated upon in my discussion forum at Wizard of Vegas .

What implications does not allowing doubling or splitting have on the house edge in blackjack?

Luke

Prohibiting doubling raises the house edge by 1.48%, while disallowing splitting increases it by 0.57%. If both actions are restricted, the house edge goes up by 1.91%.

In your last column , Eliot Jacobson inquired about the expected value when pai gow poker the first card dealt is either an ace or a joker. I assume this was linked to the ability to place a wager after seeing this initial card. Are you aware of why Eliot posed this question?

odiousgambit

To avoid upsetting the advantage player community again, I want to point out that there are specific scenarios where a knowledgeable player can confidently place a bet knowing the identity of their first card.

The following chart illustrates the likelihood of each card appearing and the corresponding advantage, provided it is greater than zero, when it serves as the first card. The conditional return represents the expected win based on the given first card, while the expected return is calculated by multiplying the probability and the conditional return.

Pai Gow Poker — Starting Card Queen or Higher

Card Probability Conditional
Return
Expected
Return
Joker 0.018868 0.257773 0.004864
Ace 0.075472 0.136483 0.010301
King 0.075472 0.038914 0.002937
Queen 0.075472 0.000534 0.000040
All other 0.754717 0.000000 0.000000
Total 1.000000 0.018141

The preceding table indicates that if a player only participates when their first card is a queen or better, their advantage for each hand dealt is 1.81%. This player will place a bet 24.52% of the time, and their per bet advantage reaches 7.40%.

Note the meager advantage of only 0.05% associated with having a queen. If we eliminate those hands from the equation, the table would appear as follows.

Pai Gow Poker — Starting Card King or Higher

Card Probability Conditional
Return
Expected
Return
Joker 0.018868 0.257773 0.004864
Ace 0.075472 0.136483 0.010301
King 0.075472 0.038914 0.002937
All other 0.830189 0.000000 0.000000
Total 1.000000 0.018101

This table illustrates that if a player only engages when their first card is a king or better, they still enjoy an advantage of 1.81% per hand seen. However, they will only place a bet 16.98% of the time, and their per bet advantage is 10.66%.

The following table is provided if the player chooses only aces or the joker.

Pai Gow Poker — Starting Card Ace or Joker

Card Probability Conditional
Return
Expected
Return
Joker 0.018868 0.257773 0.004864
Ace 0.075472 0.136483 0.010301
All other 0.905660 0.000000 0.000000
Total 1.000000 0.015164

This demonstrates that if a player restricts their play to instances when their first card is an ace or joker, their observed advantage per hand is 1.52%. They will place a bet 9.43% of the time, with a per bet advantage of 16.07%.

For additional insights on this question, visit my forum at Wizard of Vegas .

Imagine a plane flying directly above you at an altitude of 5 kilometers. You launch a heat-seeking missile towards it from the ground. The missile is always directed straight towards the plane. The plane flies at a speed of 10 kilometers per minute, in a linear path, and retains its height. The missile moves at 11 kilometers per minute. How long will it take for the missile to reach the plane?

anonymous

To view an integral that you may find helpful, click on the black area below.

The integral of (1+x^2)^0.5 dx equals ln(x + (1+x^2)^0.5) plus a constant of integration.

To discover the answer, click on the black area below.

55/21 minutes = 2.6195 minutes = 157.1429 seconds.