Sie sind auf Seite 1von 5

The USB problem

Matej Kerekrety
Faculty of Mathematics, Physics and Informatics
Comenius University
May 4, 2017

1 Problem
To plug the USB cable or device into the USB socket might take a couple of
attempts to connect it correctly. The intuition might says that the probability
is 21 . Well, the problem might be little bit more difficult. Internet community
knows the problem very well and expresses it in natural way, in memes:

Figure 1: Lets see. Maybe we are using wrong assumption.

Figure 2: Even Intel has its own answer to the problem, using quantum physics

1
1.1 Ways to connect or not to connect the USB port
1.1.1 First round
First we have to realize that there are three options which may occur in first
attempt.
Connected
The situation which empirically might appear impossible, connect to the
USB port on the first attempt.
Not connected - wrong position
The second option is to has the USB socket flipped and, therefore, it is
impossible to connect it.
Not connected - right position
The last possibility is that you have your USB in right position, but you
might not hit the socket, because you hold the port in angle impossible
to connect the socket and your brain might think the port is in flipped
position.
The assumption is that all mentioned options may occur equally. They have
probability 13 .

1.1.2 Second round


To the second round occur if we have a flipped port or we did not hit it. So, we
turn the USB, then following scenarios may occur:

Connected
The port was flipped and by truing it with 50% chance, we successfully
made a connection.
Probability: 13 12 = 16
Not connected - wrong position
In the first round the port was in right position, we turned it and, therefore,
it is a 100% chance of unsuccessful connection.
Probability: 13 1 = 13
Not connected - right position
The port was flipped and by truing it with 50% chance we did not hit the
port.
Probability: 13 12 = 16

2
Figure 3: Scenarios after turning the port on diagram.

1.1.3 Generally
The problem can be as described as tree. If the port is flipped to the right
position, the branch is branching into two branches. If the port is connected,
then the branch is finished and the branching is stopped. If the port has a right
position but we missed the socket then the following round would be also a fail,
because we are going to plug the UBS in flipped position. The tree in first four
rounds looks like this:

Figure 4: First four rounds on diagram.

1.2 Probabilities
To succeeded in the first round is 31 , to succeeded in the second round requires
to have the port in flipped position and then do not miss the socket, therefore,
the probability is 13 12 = 61 . In the third round to be successful we need in
the first round miss the socket, then in the second round flipped the port and
finally turn second time and connect correctly, the probability is the same as in

3
the second round 13 1 21 = 16 .
In generally we can denote in a following way:

Theorem Let X be the random variable, denoting the number of attempts to


plug successfully the USB port into the socket.
Probability:

1  1 b k2 c
P (X = k) = , k = 1, 2...
3 2
k
where 2 denotes the floor function1 .

Theorem The sum of probability of all possibilities is equal to one.


Proof:
 s 
X X 1  1 b k2 c 1 X 1 1 
P (X = k) = = 2s = k = 1+2 = 1+2 = 1
3 2 3 s=1
2 3
k=1 k=1

Theorem The theoretical expected values is approximately E(X) 2.1556


Proof:

X 1  1 b k2 c 1  X  1 s 
E(X) = k = 2s = k = 1 + 2s =
3 2 3 2
k=1 k=1
 1 s X  1 s 
1 X
= 1+ 2s + (2s 1) =
3 2 2
k=1 k=2
 1 s X  1 s X  s 
1 X 1
= 1+ 2s + (2s) =
3 2 2 2
k=1 k=2 k=2
 1 s  1 s 
11 X X
= + 2s + (4s) =
3 2 2 2
k=1 k=2

1  3 X  1 s 
= + 4s
3 2 2
k=2

Using the Integral test for


 convergence [integral], we can approximate the
P s
1
value of the series k=2 4s 2
 1 s
lim 4s =0
k 2
1 More on http://mathworld.wolfram.com/FloorFunction.html.

4
Z  1 s
X  1 s Z  1 s
4s ds 4s 4s ds
2 2 2 2 2
k=2

22s (sln(2) + 1)
Z  1 s
4s ds =
2 ln2 (2)

222 (sln(2) + 1)
Z  1 s (2ln(2) + 1)
4s ds = = 4.9668
2 2 ln2 (2) ln2 (2)
Therefore
E(X) 2.1556

1.3 Conclusion
To connect the USB port correctly is a tricky problem (proven by the internet
society) and we might think that it does not follow the laws of mathematical
probability. This article tries to give certain solution to explain the issue. The
assumption uses three states or positions of the USB port and that can be a
matter of discussion.

M uzeme o tom vest spory,


m uzeme s tm nesouhlasit, ale to
je tak vsechno, co se proti tomu
da delat.

Jara Cimerman

References
[1] Integral test for convergence,
https://en.wikipedia.org/wiki/Integral test for convergence.

Every time you use Wikipedia as


a source, little cute kitty dies.

Abram Lincoln

Das könnte Ihnen auch gefallen