The Real Mathematical Theory Behind the Health Code (Red, Yellow, and Green) System in China, Beyond Mass Surveillance Conspiracy

The epidemic prevention and health control code system was implemented in Hangzhou as early as mid-February and has now been promoted in most provinces across the country. Different colored codes are assigned to citizens according to different scenarios and locations, and three colors of green, yellow, and red are generally adopted throughout the country.

Despite the colors, the system differs from a traffic light system as the yellow code does not represent a transition from red to green or vice versa.

Instead, amongst the codes, the “red code” represents those who have had close contact with a COVID-19 infected person in the past 14 days, the “yellow code” represents those who have experienced symptoms such as a fever or cough in the past 14 days, and the “green code” represents no history of exposure of any kind.

It is relatively easy to understand the “yellow code” because the symptoms are related to COVID-19.

How is the “red code” generated?

Firstly, to answer this question, one must understand the mathematical principles of epidemic spreading.

Assuming that a COVID-19 infected person attended a gathering of 300 people and the average infection rate was 2%, 6 people would therefore be infected.

If these 6 infected people attended other gatherings with similar sizes and infection rates, there would be 36 (6×6) people infected, and so on, as the geometric progression of 6, 36, 216, 1290, 7776 would increase.

According to the health code system, those who have had close contact with COVID-19 infected people would automatically be switched to the “red code”. For example, in the above scenario, those 300 people who attended the same gathering as the infected people would be switched to the “red code”. They would also be restricted from attending any other gatherings for the next 14 days.

Furthermore, all gathering places, such as eateries, restaurants, and supermarkets, are assigned a QR code with specific identification of that gathering place. Citizens are required to check-in to said places by scanning the QR code with their smartphones before they are allowed to enter. If the “red code” was shown on their smartphones, their access to the gathering place would be denied. A “green code” would mean the citizen was free to access the gathering place, but the person’s access records would be submitted to the central server. Whenever there were reports of COVID-19 infected people, the server would search for those who had had close contact with the infected person and turn those people’s “green codes” to “red codes” for 14 days.

If the system can prevent just 2 out of 6 infected people from attending other gatherings, then the number of infected people would be greatly reduced to 4, 16, 64, 256, and 1024.

The mathematical formula outlined here was written in an article published in a medical science journal called “Coronavirus”, published by Bentham Science Publisher with a Nobel Prize winner as a senior advisor.

The health code system has been proven to be very effective at controlling the spread of COVID-19 across the countries which use it. This fact can be easily verified by watching foreign traveler YouTubers ( who took videos in the downtown areas of different major cities. In the video, Chinese residents can be seen walking freely and looking happy, and most of them are not wearing face masks.

Hangzhou, where the health code system was started in February, is the home base of Alibaba. The system was invented by Alibaba, and different versions of the system have subsequently been launched in different cities and provinces. Initially, due to the differing degrees of COVID-19 impact, going from one city to the other, citizens were required to take a COVID-19 diagnostic test. In the last few months, however, the diagnostic test has been completely removed as the system of all cities/provinces, to reach a common standard.

Can we adopt this health code system from China to something which would be acceptable to the western standard, avoiding mass surveillance and raising concern over privacy?

A Hong Kong company has coincidentally come up with a system based on the same mathematical formula as the health code system. However, this system uses a method which doesn’t raise as much concern over privacy issues –

The system received recognition from UNWTO and WHO during an urgent call for a COVID-19 solution with over a thousand competitors.

In contrast to the health code system, this new system uses public transit smart cards instead of smartphones. It also uses dedicated terminal devices that can read smart cards, instead of QR codes being placed in public places.

It is only the anonymous serial numbers which are recorded, with no direct relationship to their owners. This system will therefore reduce the psychological concern over using smartphones to check-in to places.

Furthermore, this system is believed to help to solve the problem of domestic lockdown, and to make traveling amongst countries possible.

This system has started to be installed in public schools, wet markets, elderly homes, and restaurants in Hong Kong, as well as being given pilot runs in Pasig City of the Philippines and Dhaka of Bangladesh.