If I try the pickup code of the self-collection cabinet repeatedly, can the cabinet door be opened?

If I try the pickup code of the self-collection cabinet repeatedly, can the cabinet door be opened?

I often go to the self-collection cabinet to pick up the things I bought online. The collection process of the self-collection cabinet is as follows: when the purchased items arrive, the logistics system will send a collection code (for example, D333EA) to your mobile phone, and then you go to the self-collection cabinet to enter the collection code and you can take out your purchased items.

Everyone is accustomed to this process, but has anyone ever thought about this question: a large self-pickup cabinet has hundreds of cabinets. If I don’t buy anything but try again and again in front of the self-pickup cabinet, or if I press the wrong code when picking up the item, is it possible that I can accidentally open a cabinet and take away other people’s goods?

Image source: Tuchong Creative

The answer is no. Why? We can use mathematics to answer.

If you can stand in front of the self-service locker for 24 days without eating or drinking and not be taken away

Suppose a self-collection cabinet has 1,000 cabinets, and each cabinet corresponds to a 6-digit pickup code. Each pickup code only contains numbers 0 to 9 and letters A to Z. If you enter the pickup code randomly, how many times do you need to enter it to open a cabinet?

This is a probability question. First of all, we know that the pickup codes of the self-collection cabinets are generated approximately randomly. Therefore, there are 36 possibilities for each pickup code in the 6-digit pickup code (10 numbers + 26 letters), so the probability of entering the pickup code correctly is 1/(36^6). The probability of opening one of the 1,000 cabinets at one time is 1000/(36^6).

If you are not sensitive to this number, let's calculate how many times you need to enter to have a 1/10 probability of opening one of the cabinets. The calculation formula for this number n is:

The calculation shows that n≈210720, which is about 210,000 times. Assuming that the pickup code is entered once every 10 seconds, you need to stand there without eating or drinking for more than 24 days. Note that this is only a 1/10 probability.

Using mathematical thinking to look at the probability of opening the self-service locker

If we put aside the complex calculations above and use only one sentence to answer why it is difficult to open a locker by random attempts, it is because the access codes that can open the lockers are too sparsely distributed. Explain what sparse distribution means. Suppose you have some lockers in front of you, each of which has its own access code, and the access code is randomly generated within a given range.

To make it clearer for readers, let's look at the simplest case. Assume there are only 10 lockers and the pickup code is only 1 digit. Then the pickup code must be among the 10 numbers and 26 letters. We can imagine a straight line with 36 points on it (see Figure 6-1), and each point corresponds to a number or letter. Then the pickup codes that can open these 10 lockers (10 large dots in the figure) are 10 of the 36 points on this line.

As can be seen from Figure 6-1, it is easy to select a large dot by randomly selecting a point. This also means that it is easy to open a cabinet by randomly trying a pickup code.

Assuming that the pickup code has 2 digits, we regard the first digit of the pickup code as the horizontal axis containing 36 points, and the second digit of the pickup code as the vertical axis containing 36 points. Therefore, all possible pickup codes are located at the intersection of a two-dimensional plane, as shown in Figure 6-2a. The figure also shows the large dots corresponding to the 10 randomly generated pickup codes that can open the cabinet. We can see that at this time, the distribution of these 10 points is very sparse. It is difficult to select the position of the large dot if you try randomly.

If the pickup code becomes 3 digits, then the pickup code is represented as a point in three-dimensional space. We show all the points corresponding to the possible pickup codes and 10 randomly generated points (large dots) that can open the cabinet in Figure 6-2b. It can be seen that these 10 points have become more sparse.

We can imagine that because the real pickup code has 6 digits, each pickup code is a point in the six-dimensional space, and the points that can open the pickup code of the withdrawal cabinet will be very sparsely distributed. Guessing the pickup code is like finding a needle in a haystack, which is almost impossible to do by luck. Therefore, sparsity is the key to the security of the pickup code.

Mathematical thinking tells us that the world is sparse

Mathematics has a clear definition of "sparseness". If a time signal is sparse, then the values ​​of most positions of this time signal are zero. Figure 6-3a shows such a sparse time signal.

If an image is sparse, then most of the pixel values ​​in this image are zero (the corresponding color is black). Figure 6-3b shows a sparse image.

Let's look at a real-world time signal:

Smart bracelets are now very popular and can measure people's exercise conditions, as shown in Figure 6-4a. Smart bracelets use acceleration sensors to collect the original signals of the acceleration of the arm when people exercise, and then process the signals to obtain corresponding information, including the number of steps taken, the distance run, etc. If we display the original acceleration signal, it should be similar to Figure 6-4b.

The original acceleration signal looks completely different from Figure 6-3a and is not sparse.

However, I want to tell you that although the original acceleration signal does not look sparse, if it is expressed in Fourier series, it is sparse (see Figure 6-6).

We can see that among all the sine waves used to represent the original signal, only a few sine waves have higher frequencies, and the frequencies of the other sine waves are very low. This means that except for a few sine waves, the coefficients in front of most sine waves are almost equal to zero.

In other words, the frequency domain representation of this time signal is sparse.

In addition to time signals, images in our daily lives are also sparse. The principle is very similar to that of smart bracelets. Although the original image in Figure 6-8 is not sparse, we can use a mathematical tool called singular value decomposition to decompose this image into a superposition of a series of very simple images. The images on the right side of the equation are very simple. If you look closely, you can find that these simple images are composed of horizontal and vertical bars, but the positions of the horizontal and vertical bars are different in different simple images.

We can say that each simple image corresponds to a pattern in the original image.

Although the original image looks rich and not sparse, we can represent it with only a few simple images.

Some people may ask, what are the benefits of this representation? The benefits are mainly reflected in data compression.

The storage space required for a simple image is much smaller than that for the original image. In this way, we only need to store a small number of simple images corresponding to relatively large coefficients together with the corresponding coefficients to restore the original image. This greatly compresses the storage space required.

So you see, mathematical thinking can be found everywhere in our daily lives. Sparsity exists in every step we take, every image we store, and every pickup code we enter. Many seemingly complex phenomena actually have sparse and simple rules behind them, as long as you learn to use mathematical thinking.

The article is produced by Science Popularization China-Starry Sky Project (Creation and Cultivation). Please indicate the source when reprinting.

Author: Liu Xuefeng, Associate Professor and Doctoral Supervisor at Beijing University of Aeronautics and Astronautics

Reviewer: Deng Qingquan, Associate Professor, School of Mathematics and Statistics, Central China Normal University

<<:  Don’t rinse your mouth after brushing your teeth! Otherwise, you’ve brushed in vain! Most people don’t know…

>>:  You eat fruits to whiten your skin, but end up getting darker?

Recommend

Virtual reality hit products are zero-hypothesis hype

What is the new trend of the Internet? The bigges...

Double 11 is marketing, not promotion

Tmall Double 11 just ended, generating sales of 4...

8 ways to make your app icon stand out

The app icon plays a very important role in the c...

Five ways to promote and attract new customers on APP

Now when you open the app store , whether it is f...

We have summarized ten changes for you to understand in iOS 10 beta 4

On the morning of August 2, Apple released the fo...

Fish don't have hands, so what do they do when they feel itchy? | Nature Trumpet

Welcome to the 20th issue of the Nature Trumpet c...

This parrot's dopamine dressing style is really hard to learn!

The gateway to the eastern and western hemisphere...

Konka TV slim: a double winner in terms of appearance and usability

With the continuous development of TV technology ...