Skip to main content


A Faro shuffle is probably one of the most intricate skills in an elite magician's arsenal. Although it's simple in concept, it is extremely difficult to perform and it typically needs years and years of practice. The idea of a shuffle is to randomize the cards, and since a typical shuffle is sloppy, that is usually true. However, a Faro shuffle is not random at all. In a perfect shuffle or a Faro shuffle the cards are divided exactly in half (top and bottom) and then interspersed alternately. Twenty one consecutive (out) Faro shuffles for a 50-card deck. However, it only takes eight consecutive Faro shuffles to bring a 52-card deck back to its original order. Interesting.


If the number of cards in the deck is 12,

public class outFaro {
 public static void main(String[] args) {

  // the number of card in the deck
  int numberofcardindeck = 12;
  // creating an array of cards
  int[] deck = new int[numberofcardindeck];

  // printing the order of cards in original deck
  System.out.println("Original deck");
  for (int i = 0; i < numberofcardindeck; i++) {
   deck[i] = i + 1;
   System.out.print(deck[i] + " ");

  // dividing the cards in half
  int[] firsthalfdeck = new int[numberofcardindeck / 2];
  int[] secondhalfdeck = new int[numberofcardindeck / 2];

  // performing a (out) Faro shuffle
  for (int Faro = 1; Faro <= 50; Faro++) {

   for (int i = 0; i < numberofcardindeck / 2; i++) {
    firsthalfdeck[i] = deck[i];
    secondhalfdeck[i] = deck[i + (numberofcardindeck / 2)];

   for (int i = 0; i < numberofcardindeck / 2; i++) {
    deck[2 * i] = firsthalfdeck[i];
    deck[2 * i + 1] = secondhalfdeck[i];
   System.out.println("Order under Faro Shuffle: " + Faro);
   for (int i = 0; i < numberofcardindeck; i++) {
    System.out.print(deck[i] + " ");
   // done when the second card comes back to its original position
   if (deck[1] == 2) {


Original deck
1 2 3 4 5 6 7 8 9 10 11 12 

Order under Faro Shuffle: 1
1 7 2 8 3 9 4 10 5 11 6 12 
Order under Faro Shuffle: 2
1 4 7 10 2 5 8 11 3 6 9 12 
Order under Faro Shuffle: 3
1 8 4 11 7 3 10 6 2 9 5 12 
Order under Faro Shuffle: 4
1 10 8 6 4 2 11 9 7 5 3 12 
Order under Faro Shuffle: 5
1 11 10 9 8 7 6 5 4 3 2 12 
Order under Faro Shuffle: 6
1 6 11 5 10 4 9 3 8 2 7 12 
Order under Faro Shuffle: 7
1 9 6 3 11 8 5 2 10 7 4 12 
Order under Faro Shuffle: 8
1 5 9 2 6 10 3 7 11 4 8 12 
Order under Faro Shuffle: 9
1 3 5 7 9 11 2 4 6 8 10 12 
Order under Faro Shuffle: 10
1 2 3 4 5 6 7 8 9 10 11 12 

After 10 out-Faro shuffles, the card returns to its original permutation. Therefore, 10 is the order of the permutation.

The table below shows number of cards in a deck and the number of out-Faro shuffles required to bring it back to its original permutation.

The definition of permutation and permutation group:

“A permutation of a set A is a function from A to A that is both one-to-one and onto. A permutation group of a set A is a set of permutations of A that forms a group under function composition.”

A Faro Shuffle is one-to-one and onto. At any frequency of the shuffle, every index (1-n) will have a unique card. Also, for every card, there is a unique index regardless of the frequency of the shuffle. The permutation for every “Number of cards” can be thought as a group under the operation - FaroShuffle. Also, since “Number of Faro Shuffles” returns us back to the original permutation, we can establish it as the order of the permutation group.

Theorem: The order of a permutation of a finite set written in disjoint cycle form is the least common multiple of the lengths of the cycles.The order of a permutation of a finite set written in disjoint cycle form is the least common multiple of the lengths of the cycles.

This is one of the most important Group Theory Theorems. Let us consider a 52-card deck to demonstrate this. From the Java code, the order is 8 when n is 52. Instead of looking at disjoint cycle form of the permutation to figure out the order of each element, we can also look at every permutation the original permutation has been to before returning to the original permutation. For n = 52, the table below shows all the permutations. 

From the table above, order of 1 and 52 = 1, order of 18 and 35 = 2 and order of rest of the elements = 8
The  L.C.M (1,2,8) = 8 is the order of the group according to the Theorem. This is also what we got from the Java code.

Conjectures / Proofs:

In-Faro and Out-Faro

In an out-Faro shuffle, the top card from first half of the deck always remains on top. In an in-Faro shuffle, the top card from second half will be the new top card of the new shuffled deck.

Since I did not have a deck of card with me, and I was bored, I wrote a very simple Android app to demonstrate in and out shuffle.  

Generating a random deck with 4 cards. Notice that the Eight of Hearts is on top.

Out-Faro 1:  Eight of Hearts is on top.
Out-Faro 2:  Eight of Hearts is still on top and the deck is back in its original permutation. Therefore, order = 2.

In-Faro 1:  Using the same deck, Eight of Hearts is no longer on top.

In-Faro 2:  Again...
 In-Faro 3:

  In-Faro 4: Back to its original order. Order = 4.

More screenshots:

Another reason for writing the app was to see the connection between Binary Number System and Faro Shuffle. I read somewhere that magicians and gamblers use this for their advantage.

Consider a random eight card deck.

 Now, the trick is, to send the Queen of Clubs to say for example, 7th position in the deck (6 cards on top of it), the gambler would perform two in-Faros and one out-Faro. 6 in binary is 110; so, for digit 1, the magician would perform an in-Faro and for 0, an out-Faro.

1st in-Faro:

2nd in-Faro:


 Queen of Clubs is now in the 7th position. Also, its really interesting that this works irrespective of the number of cards in the deck.

I also found that the order of (2n+2) out-Faro shuffle is equal to the order of (2n) in-Faro shuffles.

I find that pretty interesting and I do not really see that to be obvious. It also implies that for no 2n, In-Faro=Out-Faro (I think). I will be investigating on these more later.

Popular posts from this blog



The Zorganian Republic has some very strange customs. Couples only wish to have female children as only females can inherit the family's wealth, so if they have a male child they keep having more children until they have a girl. If they have a girl, they stop having children. What is the ratio of girls to boys in Zorgania?
The ratio of girls to boys in Zorgania is 1:1. This might be a little counter-intuitive at first. Here are some ways of tackling this problem. 1. Monte Carlo Simulation: Although, Monte Carlo simulation does not necessarily show why the result is 1:1, it is appropriate because of the very counter-intuitive nature of the problem. At the very least, it helps us see that the result is indeed 1:1. Therefore, this is a good start.
The following R code estimates the probability of a child being a boy in Zorgania. 
couples <-100000 boycount <-0for (i in1:couples){ # 0: boywhile (sample(c(0,1),1) ==0) { boycount=boycount+1 } } probability <- boycount/(co…

Simple Launcher

A simple minimal launcher application for Android devices that shows battery percentage using lzyzsd's CirclProgress library (ArchProgress used in this case) and BroadcastReciever for battery state, Android's clock widgets, a built-in flash light switch and an app list view that can be toggled. Currently, the toggle simply filters all the app that I am working on at present. Future implementation can allow users to select their favorite apps or populate second toggle based on the most used applications.