Share your repls and programming experiences

← Back to all posts
##### Pseudo Random vs. Quantum Random

Today I will try to explain pseudo random and why quantum random is better.

# Pseudo Randomness

What is pseudo random and why is it terrible?

Pseudo random is a program that takes an seeds and returns an output,

The mathematical operations used to return the output are unorthodox, such as getting some of the digits of a bigger number.

The problem with pseudo random is when you keep using the same seed, you keep getting the same output.

This makes the "random" predictable, and no longer random.

# Pseudo Random Code Explained

The code uses 4 variables such that:

• Module --- 0 < M
• Seed --- 0 =< S < M
• Multiplier --- 0 < Mu < M
• Increment --- 0 =< I < M

With these variables, the program returns:

``````output = (Mu * seed + I) % M
print(output)
seed = output``````

Pros:

• Very Easy to code
• Return numbers fast

Cons:

• If you plug in the same seed, you will always get the same output.

# Quantum Randomness

It's really quite simple.

In a lab in Australia, there is a box with virtually no matter inside of it.

Quantum physics forbids this, so it creates virtual matter.

This "virtual matter" appears and disappears because this vacuum is a zero-point energy field.

The electromagnetic field of the vacuum exhibits random fluctuations in phase and amplitude at all frequencies, because of the appearances and disappearances of "virtual matter".

The lab in Australia records the fluctuations, and post it for public use.

If you didn't understand it. It's okay.

Nobody understands quantum physics.

# Quantum Randomness Code Explained

The way that this was created public was that somebody created a module that we can use.

So we just use it:

``````import quantumrandom
print(quantumrandom.randint(0,1))``````

For more functions, visit : https://pypi.org/project/quantumrandom/

Pros:

• True Random

Cons:

• Returns 1 number per second

Please correct me if I get anything wrong.
I don't fully understand this topic.
I just want to let you know it exists.

Thank you for coming to my TED talk.

You have an extra `"`: