### Riddler 2022-07-29: Can You Beat the Shell Game... Quantum-Style?

Riddler 2022-07-29: Can You Beat the Shell Game... Quantum-Style?

Having solved the shell game in this week’s Express, you are now ready to play the quantum shell game. Instead of a ball, you are now trying to capture an electron. Now, you’re not sure precisely where it is, but you know it’s somewhere on a two-dimensional surface. What’s more, you know that the probability distribution is a 2D Gaussian (or “normal”) distribution. More precisely, the probability the electron is a distance r units in any direction from some central point is proportional to exp(−r²/2).

You have four cylindrical cups, each of which has a radius of 1 unit. In this game, you want to place the cups over the surface to maximize the probability that the electron is in one of the cups.

How should you place the cups, and what is the probability you will catch the electron?

You have four cylindrical cups, each of which has a radius of 1 unit. In this game, you want to place the cups over the surface to maximize the probability that the electron is in one of the cups.

How should you place the cups, and what is the probability you will catch the electron?

Let a be the constant of proportionality for the probability function of the electron. This means we can express the probability as a*exp(−r²/2). Over the whole plane, this value should equal 1:

∞

∫

-∞

∞

∫

-∞

2

x

2

y

2

I’m already too far over my head, so let’s see what Mathematica has to say:

In[]:=

SolveaExp-+yx==1,a

∞

∫

-∞

∞

∫

-∞

2

x

2

y

2

Out[]=

a

1

2π

So there’s our probability function:

In[]:=

f[x_,y_]:=

Exp-+

2

x

2

y

2

2π

Now, I just need to figure out how to integrate that over a circular region. Again, this is too tough for me (it might’ve been too tough for me even after my multivariable calculus class).

In[]:=

Integrate[f[x,y],{x,y}∈Disk[]]

Out[]=

1-

1

In[]:=

N1-

1

Out[]=

0.393469

That should be the probability that one cup centered on top of the electron “peak” catches the electron. (The Disk[] function defaults to a unit circle at the origin.) Let’s try that with a cup somewhere else (let’s say right next to the first one):

In[]:=

Integrate[f[x,y],{x,y}∈Disk[{2,0}]]

Out[]=

∫

{x,y}∈Disk[{2,0}]

1

2

2

x

2

y

2π

It’s always nice to get my input back as output. Let’s try approximations:

In[]:=

NIntegrate[f[x,y],{x,y}∈Disk[{2,0}]]

Out[]=

0.0818923

Since the actual location of the cup doesn’t matter (only the distance from the peak), we can make a function that just has the distance from the center of the cup to the electron peak as its argument. (I’ll also make a version that takes a list of distances and return the total probability.)

In[]:=

vol[d_]:=NIntegrate[f[x,y],{x,y}∈Disk[{d,0}]]

In[]:=

vol[l_List]:=Total[vol/@l]

Let’s start by looking at the 2-cup problem. There are two sensible (to me) placements for the cups: (1) one cup centered on the peak and the other cup touching the first cup: (Notation note: vol@{0,2} is identical to vol[{0,2}] but with reduced bracket clutter.)

In[]:=

vol@{0,2}

Out[]=

0.475362

...and (2) both cups touching at the peak:

In[]:=

vol@{1,1}

Out[]=

0.53424

Just to be sure about that, I’ll make a plot that assumes the peak is somewhere on the line between the centers of the cup:

In[]:=

Plot[vol@{n,2-n},{n,0,2},GridLines->Automatic]

Out[]=

We now have an answer to a question that wasn’t asked. Yay!

Getting to the actual question at hand (the 4-cup problem), I can think of a few arrangements: (1) one cup centered on the peak and the other cups touching it (it could be a Y shape, a T shape, a diamond; they all have the same set of distances to the peak):

In[]:=

vol@{0,2,2,2}

Out[]=

0.639146

(2) the cups arranged in a square around the peak:

In[]:=

vol@

2

,2

,2

,2

Out[]=

0.72276

(3) the cups arrange in a square, but the peak is at the intersection of two of the cups:

In[]:=

vol@1,1,

5

,5

Out[]=

0.644036

(4) something in between those:

In[]:=

Plotvol@

1+

,2

n

1+

,2

n

1+

,2

(2-n)

1+

,{n,0,2},GridLines->Automatic2

(2-n)

Out[]=

...and (5) a diamond with the peak in the middle:

In[]:=

vol@1,1,

3

,3

Out[]=

0.777891

Unless I can come up with some other arrangement, that’s our answer. Let’s put it in a semitransparent box with the 2022 PANTONE Color of the Year, Very Peri:

In[]:=

answer[cups_,val_]:=ToString[cups]<>" cup answer:"Framed[PercentForm@val,Background->RGBColor["#6667ab7f"],FrameMargins->15]

In[]:=

answer[4,vol@1,1,

3

,3

]Out[]=

4 cup answer:

Extra credit: What if you have different numbers of cups, like three, five, six or even more? How would you place the cups, and what would be your chances of catching the electron in one of them?

I’m going to make a few helper variables and functions to help me out.

In[]:=

o={0,0};

dist@{peak, centers} will take the location of the peak and a list of centers and return a list of the distances from the peak to each center:

In[]:=

dist@{peak_,centers_}:=Norm/@(#-peak&)/@centers

The {peak, centers} construction will be used repeatedly. Here’s our first answer:

In[]:=

soln4=o,{-1,0},{1,0},0,

3

,0,-3

Out[]=

{0,0},{-1,0},{1,0},0,

3

,0,-3

In[]:=

value[struct_]:=vol@Simplify@dist@struct

In[]:=

value[soln4]

Out[]=

0.777891

This allows the electron peak to move around -- this can make things easier when trying to find the right place for a certain arrangement of cups.

In[]:=

display[struct_]:=ContourPlot[f@@({x,y}-struct[[1]]),{x,Min[struct[[2,All,1]]]-1,Max[struct[[2,All,1]]]+1},{y,Min[struct[[2,All,2]]]-1,Max[struct[[2,All,2]]]+1},RegionFunction->Function[{x,y,f},Min[dist@{{x,y},struct[[2]]}]<=1],AspectRatio->Automatic,Epilog->Point[struct[[1]]],FrameLabel->ToString[Length[struct[[2]]]]<>" cups: "<>ToString[PercentForm@value[struct]],Contours->Range[0.0,0.16,0.01],ContourStyle->None]

In[]:=

display[soln4]

Out[]=

Some possible solutions for 3 cups:

For 6 cups, a triangle seems best. I’ll make the list of centers first, then provide peaks separately:

Spoiler alert: This is the best value I found.

It literally doesn’t matter here since it doesn’t change the distance from the cup to the peak, but I can use the /. and -> combo to change the location of the third center (the one on the bottom right of the triangle) to make a 2-by-3 parallelogram:

For 5 cups, a lot of the possible answers look like the bottom two rows of our pyramid:

But where should I put the peak?

Checking all the peak locations on the y-axis:

Can I go further? I’ll guess/assume that 7 cups is a hexagon:

...but actually making the hexagon will help with the next steps:

I’m guessing that the 8-cup solution will have another cup nestled on top of the hexagon, but the center might be slightly off the origin:

Would a more triangular arrangement be better?

Guess not.

Two interesting options for 10 cups: a full triangle of side 4 or an elongated hexagon.

I had come up with a notation for the arrangements of cups when I was trying to write out the answer in the answer form. It’s assumed that the shape has symmetry around the y-axis. (If it isn’t, I can remove cells via set complementation.) The number of cups in each tier are listed from the bottom up. Finally, I have an offset value that changes the row of cups that lie on the x-axis (0 means the bottom row is on the x-axis). The result:

Using the best arrangement of 10 cups as an example:

This should make constructing the patterns of cups easier. Back to the 11-cup case:

That’s not a whole lot. Perhaps it’s time to try to figure out what the scores will be with an infinite number of cups -- and by “infinite,” I mean “a few hundred.” I’ll use the patt[] function to make a square of cups, then find how many of them are within a radius of 20 from three specially chosen peaks: one at the origin, one where two circles meet, and one in between three circles.

I already gave a name to the origin; here are names for the other peaks:

As it turns out, the best placement for the electron peak is on the border between cups (like in the 4-cup solution). Next is in between three cells (like in the 3-cup solution). Finally, the worst is putting a cup centered on the peak (like in the 6-cup solution).

I though that there might be some bias based on the exact radius of the circles we’re testing now, so I decided to plot the total probability for each arrangement as the radius all the cup centers had to be between went from 20 to 21.

I don’t know why the colors don’t work, but it’s pretty clear there’s not a significant difference in these results.

I wanted to make a contour plot or 3D plot of the “infinite” cup arrangement based on the location of the peak, but that took too long. So, this is just the value as the peak moves from (0, 0) to (1, 0)...

It occurred to me that I could probably check how much volume is a radius of 20 from the peak:

That seems small. How small is it?

Oh. Seeing that so little space is left for our electron, I feel safe to say that we have our final final answer:

Jenny Mitchell

July 2022

July 2022