# How does the Grover's Algorithm work with a real example? [duplicate]

I am new to this field and I have been baffled by the idea of Oracle for a long time.

I am aware of the procedure, but I am very confused about how we choose the oracle.

Let say we have 4 poker cards, the spade of Ace, the club of 7, the heart of 9, and the diamond of 7. I shuffled the four cards and now I want to know where is the spade of ace.

I would first encode the cards, say 00, 01, 10, and 11 respectively for the spade of Ace, the club of 7, the heart of 9, and the diamond of 7.

To solve the problem on a quantum computer, I will first initialize the system in the superposition of the four states, and I apply the oracle corresponding to $$|00\rangle$$ (see Qiskit), and evolve the state and everything, I will finally end up with the state $$|00\rangle$$.

My question is how does this result help me in any way? I wanted to know the position of the spade of Ace in the deck of cards but instead I got a state $$|00\rangle$$, which means spade of the Ace. Am I missing a step somewhere?

I would appreciate it if the answer could continue with the example, and show from beginning to end how one can find the position of the card.

Of course this example is a bit too small to really make sense anyway, since you can just look at all the cards. If you had a full deck of 52 cards, it would make a bit more sense: Grover's algorithm could tell you the position of the spade of Ace after only "looking at" $$\approx\frac{\pi}{2}\sqrt{52}\approx 11$$ cards (although you would need some way to look at cards in a coherent superposition).