← Back to archive
Data Forecasting

Solved the Problem of Using True Random Numbers for Divination

术数起卦随机数

For divination systems based on spiritual intuition, to achieve accurate predictions, one must first find data that is currently unpredictable, and then derive predictable results from this data. This is a rather contradictory logic.

The unpredictable data is naturally true random numbers. As for whether true random numbers actually exist or not, it is difficult to say; it is a philosophical issue. Although everything is a manifestation of probability, what determines probability?

Back to the topic. Initially, I checked Taobao for hardware true random number generators, but the omnipotent Taobao was disappointing. Then I checked the computer's CPU and found it was an Intel CPU. Intel CPUs do provide true random number generators, so I had the idea to directly access the Intel CPU. After checking, I found that I needed to download Intel's math library, so I started downloading it slowly.

After downloading, I surprisingly found that it couldn't run because the version was too old and didn't support Xcode 6, so it didn't even allow installation, forcing me to give up.

So I looked for other ways to obtain random numbers through this method. After spending a long time, I was lucky enough to find an article stating that Intel provides direct access to the CPU using assembly instructions.

Then the trouble began. This is a MAC system, and the compiled output is a dylib library. Then I tried to call it through Mono, but no matter what, it kept prompting that the call failed and the file could not be found. I continued searching websites and finally discovered that, originally, it could only be compiled as 32-bit for Mono to call it. After several rounds of trial and error, I successfully implemented the call to true random numbers.

I have to say, resources in China are really hard to find; English websites have more comprehensive information. Although I spent the whole night struggling, it was worth it. Being able to call true random numbers can solve many problems.

The generated true random number image is as follows:

Random image generated by Intel CPU

 And the random numbers generated by the same drawing algorithm in C# are as follows:

C# Random Image

  It is quite strange that the difference is not very obvious. Is it because the MAC's underlying random number algorithm is done extremely well? So it approximates the effect of true random numbers?

However, I think there will still be differences between pseudo-random numbers and true random numbers. This needs to be further verified with a large number of divination cases.

  There are some other ways to generate true random numbers, which have not been implemented, but I will mention them here:

On IPAD, IPhone, or Android devices, there is no CPU that supports random numbers. To achieve more accurate divination on these devices, especially for Plum Blossom divination, the following methods should be considered to generate an entropy pool for divination:

1. By accessing the gravity sensor, the querent randomly shakes the phone, collecting precise data from it to perform divination, similar to shaking real sticks or hexagrams. As far as I know, no one has truly implemented this yet. Most shaking divinations actually use pseudo-random numbers generated in advance, and the shaking is just for sound effects.

2. The querent randomly taps and draws on the screen, then collects data to synthesize the divination. This makes the resulting divination calculation more convenient, although intuitively the effect might be slightly compromised.

3. Turn on the microphone, collect actual noise through the microphone, and randomly sample data after dynamically adjusting the amplitude. This can be further improved by having the querent speak a sentence, as pronunciation always varies. By extracting these variations, true random sampling can be obtained.

   4. Take a photo of the user using the camera, perform calculations based on the color matrix of the photo to derive the hexagram. This method of divination should be quite effective, and it also allows the diviner to combine face reading. However, it raises privacy concerns.

  The above four divination methods can be performed on mobile devices.

Written by Master Sanfu on May 14, 2015. Please credit the source if you share.

Translation Notice: This English version was translated with AI assistance. Specialized, historical, religious, or culturally sensitive terms may contain nuances, inaccuracies, or debatable wording. In case of ambiguity or discrepancy, the original Chinese text shall prevail.