# How can quantum computing win 97% of times in coin flipping experiment?

I'm new to this field of science. I'm curious about how quantum computing can win 97% of times in a coin flipping experiment?

Refer this link: Ted Talk by Shohini Ghose

To give an idea about how this coin experiment works:

1. Quantum Computer plays a move but it is not revealed to the Opponent[Human].
2. Opponent[Human] plays a move and it is also not revealed to the Quantum Computer.
3. Finally Quantum Computer plays a move.
4. Results are shown. If its heads, then Quantum Computer wins. Else, Opponent[Human] wins.

Here, playing a move refers to "Flipping the coin". The video talks of superposition and how it can recover heads every time in the final move. This made me think about 2 possibilities:

1. Quantum computer is tracking something low level in hardware. So, it knows every time, what did the opponent played.
2. Superposition and the third state is just a way, to not consider Opponent's Move (i.e. Ignoring Opponent's move). So, it is actually all the moves of Quantum Computer. So, it knows how to win. If this is the case, then actually there is no randomness or uncertainty added in the game by Opponent.

Just same as how the magician does the coin flipping trick. He practices and controls the flipping power of his thumb, so he knows every time he flips the coin, whether its going to be heads or tails.

• watching the video, I'm even more confused than before. So the computer wins the game if it gets heads at the end, that's it? So what is the role of the user playing at all?? Why can't you win this "game" with a classical computer by simply outputting heads every time? – glS Jan 26 '19 at 17:50
• No you cannot simple lets a classical computer outputting heads (according to the rules because it needs to do a coinflip so it needs to be a random thing). According to her own comment it's about putting the qubit in superposition and then reverse this state. So just start with one or two qubits with a hadamard gate on the first qubit and a second hadamard on the same qubit ted.com/talks/… – Bram Jan 26 '19 at 22:16
• @Bram but the thing is that the quantum computer is effectively doing something like that. It goes in a state in which the action of the player does not change anything. I find misleading to state that this is some sort of "quantum equivalent" of the classical version of this game – glS Jan 27 '19 at 11:03
• A slight problem is that Dr. Shohini uses the phrase "flip the coin" both to the H gate applied by a quantum computer and X gate applied by a human player. Indeed - as Dr. Shohini explains -, in a case of two human players, the last one would perceive either |0> or |1> with p=1/2, assuming the previous two flips were fairly distributed. – Szymon Apr 10 '19 at 20:58

We translate this game into conventional QC terminology as follows:

• The coin is a single qbit state $$|\psi\rangle=\begin{bmatrix}\alpha \\ \beta\end{bmatrix}$$ where $$\alpha, \beta \in \mathbb{C}$$ and $$|\alpha|^2 + |\beta|^2 = 1$$
• "Flipping" the coin is application of the bit-flip operator $$X = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$$
• The "heads" state is defined as $$|0\rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix}$$ and "tails" as $$|1\rangle = \begin{bmatrix} 0 \\ 1 \end{bmatrix}$$
• The quantum computer "plays" by applying the Hadamard operator $$H = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & \frac{-1}{\sqrt{2}} \end{bmatrix}$$

The game is conducted as follows:

1. The coin is initialized to the $$|0\rangle$$ "heads" state.
2. The computer plays, applying the Hadamard operator to the coin (operators are applied using matrix multiplication). The coin enters the $$|+\rangle = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix}$$ state.
3. The human plays, choosing whether to flip the coin (apply the $$X$$ operator). However, since the $$X$$ operator just flips the state vector upside down, $$X$$ has no effect; $$X|+\rangle = |+\rangle$$. No matter what, the state is $$|+\rangle$$ after the human plays.
4. The computer plays, applying the Hadamard operator again, taking the coin to the $$|0\rangle$$ "heads" state.

Thus the computer always wins, except for $$3\%$$ of the time when errors cause it to not behave according to this model.

The example deals with the basic quantum states $$|0\rangle$$, $$|1\rangle$$, $$|+\rangle$$, and $$|-\rangle$$, plus the common ways of moving between them with the $$X$$, $$H$$, and $$Z$$ gates. This is the same material you learn about in IBM's Hello Quantum game.

This isn't a great example to use to illustrate how a quantum computer works (since it only makes sense if you already know how a quantum computer works), but I guess the speaker only had ten minutes.

• Thanks for the explanation. So, we can say that the quantum computer, in fact cheated in this game, because player is only allowed to flip whereas quantum computer can do anything (X and H moves). So, there is actually no uncertainty and randomness in this game. @ahelwer Please, refer to my pictorial representation of the game and logic behind it (Am I correct?): bit.ly/2Wmi8Xa – Saddam Pojee Jan 27 '19 at 3:38
• Yeah that's pretty much correct. It's an interesting characteristic of quantum computers that they can neutralize the effect of certain logical operations by being in specific states. If you look further into quantum computing, the first algorithm you encounter is called the Deutsch Oracle problem - it makes use of this. – ahelwer Jan 27 '19 at 3:45
• I think TED Talks should be reviewed beforehand. Since, this talk gave me a wrong impression about quantum computing application. Thanks for clarifying the concept behind it. – Saddam Pojee Jan 27 '19 at 3:53
• It is perhaps worth adding that if somebody were to check the coin after the computer plays but before the human plays, it would appear as if they'd behaved because the checker would get a 50:50 heads or tails distribution (but, that check would invalidate the quantum strategy) – DaftWullie Jan 28 '19 at 10:54
• It would seem that for a "fair" game any of the operators I, X, Y, or Z (per en.wikipedia.org/wiki/Quantum_logic_gate#Hadamard_(H)_gate) should be available to the human player. – Thomas Bitonti Mar 9 at 18:55