How do random numbers work?

How do random numbers work?

Other urls found in this thread:

youtu.be/FfZurPKYM2w
youtube.com/watch?v=MiuLeTE2MeQ
youtube.com/watch?v=denb9xfddZs
pell.portland.or.us/~orc/Code/Misc/random.c
twitter.com/AnonBabble

they just werk

they're random

most of the time.

They're based on using an unpredictable algorithm which is cheap to compute but difficult to reverse.

For example, you can construct a rudimentary random number generator by just using some sort of cryptographic hash function (e.g. SHA256) or block cipher (e.g. AES256).

As long as hash functions stay around (they will) and encryption isn't completely broken, you can generate unpredictable pseudorandom numbers.

Serious answer youtu.be/FfZurPKYM2w

Look up linear congruence generator for a simple way to do it

There are several methods(not an exhaustive list):

Data is taking from entropy generated from your computer and numbers are generated from this data.

A mathematical functions which generates predetermined numbers which appear to be random.

Data is taking from the environment cosmic radiation etc.


In short: there are no random numbers unless you generate them by using quantum effects.

FSVO “random”.

In practice, true randomness is not a constraint you ever really need. All you need is unpredictability.

You plant a seed and maybe a chicken will grow

you fucking piece of shit cia scum

Probaly Hashing the current time and date 300 times and getting the number in last index

The current time and date is not random because it's almost completely predictable.

Try to predict the current time and date when the time and date is updated at a rate of 3 gigahertz

Seeding PRNG with time is fucking retarded is insecure.

Pleasantly surprised at how accurate this video was.

Okay. It's currently 2016-07-06 19:38:55

Not him, but you are fucking inbred if you think seconds have no fractions. Aaaahahaha, watch racing much. Fucking keklles

using all the way up to nanosecond
that would be totally random

CIA nigger fuck off

Depends on the purpose. If you're seeding a one-time key for long-term personal use based on the current nanoseconds at the time you created it, you're probably fine. (But still, why not just use /dev/random?)

If you're picking random numbers in repeated, predictable events (e.g. for establishing new HTTPS sessions), then picking the current time is absolutely retarded because I can do my own time measurements and perform correlation attacks.

And what if you use the difference in time. Like ms lag added to time from a unknown server.

If you add more and more entropy sources, your random numbers get more and more unpredictable.

But two caveats:
1. Never rely only on external entropy sources (since an attacker could control them)

2. Never rely only on the same type of entropy source (since it might not be as good as you first thought)

As a result, it's best to mix together many different entropy sources (interrupt timings, user inputs, bus jitter, voltage fluctuations, network packet delay, etc.) into a single entropy pool that is used to reseed your PRNG - which is exactly what /dev/random (and /dev/urandom) do.

Nice try CIA nigger

Makes sense user

...

But she doesn't explain how the seed itself is generated, she said "take a random seed", but that's exactly the problem.

...

See

>In short: there are no random numbers unless you generate them by using quantum effects.

What makes you think that? God doesn't play dice my friend.

I agree, nothing is truly random, but this is not /phi/ but Sup Forums

Go away bad guy

“Are quantum effects truly random?” is an inherently meaningless question. The answer doesn't affect us.

This is the question you're looking for:
“Are quantum effects unpredictable?” and the answer is yes.

People also thought the weather was unpredictable 400 years ago, just because we have no method now doesn't mean it'll never exist.

...

makes u think...

Yes and in the year 2500 when we're all fugging space aliens from alpha centauri I'm sure we'll be using different PRNG seeds as well.

But now you're leaving the realm of reality and entering the domain of science fiction.

Yes, the NY also reported that actual human flight would still take 10,000 years, just days before the Wright Brothers actually achieved it.

In computing "random" isn't a thing. The word your looking for is pseudorandom. I.e. combining different formulas that are hard to predict or recreate. Computers can't actually make a random number, it's one of their inherent flaws. They are deterministic. So you'll always have someone trying to crack the formula to better guess the numbers produced and someone trying to make a better formula. There are ways to get numbers from other sources like electrical variances, but most common ones have their drawbacks too.

I just want to believe, that's all

The nigger believes he can predict random numbers with machine learning

*holds up spork*

There's a small difference between an engineering problem that we know is possible (e.g. birds) and a theoretical physics problem that all established laws of nature say are impossible.

A change of the status quo would require a fundamental violation of all established principles of quantum mechanics.

Yes, such things happen all the time, the way we thought atoms looked has changed more than 4 times in the past 100 years, all changes we're quite fundamental.

Well, feel free to come up with a revolutionary new model of quantum physics that will allow you to precisely measure the quantum state of the processor on a PC halfway across the globe in violation of the uncertainty principle and the laws of thermodynamics.

If you can do that, then feel free to spy on my anime collection. Until then, fuck off.

But regarding our local programming domain.
Is generating random numbers using ever changing time on our local machine as input for our algorithm a good practice? I mean its always different number going in since its ticking timer...

they're just numbers which were generated or derived from a non-deterministic source
that is, you should not be able to guess the next number

pseudo-random numbers are not truly random (may be deterministic), but are used in places where speed is more important, or there's no suitable sources to use

I'm working on it, keep an eye on the news in 4000 years

He can't play dice because he doesn't exist.

How do dubs work?

i cant code but wouldn't it be easy to generate a random number

just something like


//make an array of numbers 0-9

array [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

//magic coding thingy to choose one at random

from[array].random.print(array)

//this generates a random number

Middle squares method, repeating patterns, and spaces...I learned more than I expected from this video, and I have some ideas now. Thank you based user.

what is more random
random(0-999)
or
random(0-9)
random(0-9)
random(0-9)

itt: write a standlone random numbers in any language

and how does .random work?

so does this mean that Elon Musks idea (which is idiotic to me anyway) is literally impossible; we are a simulation inside a computer?

if randomness exists on the planet, but computers can't ever be random, then we must not be in a simulation

Is that a troll attempt? If you had a magical function that chooses an index at random you'd already have a random function.

Possibilities to get pseudo random numbers:

- User input:
Let the user wiggle around with the mouse cursor -> record position -> random numbers

- Dedicated hardware:
Stuff like ARMs Trustzone or electrical Tubes which create random static.

Special algorithms:
Look up Mersenne Twister.

is it really random or is it a program returning numbers in a set pattern that appears random?

>randomness exists on the planet
like what?

nope not a troll. i just thought i saw .random function in javascript before

but even if .random doesnt exist i cant image it be impossible to code. just make it so the computer chooses a number based on an image so it would look at the image, find its favorite color/pixel, and count the pixel in the image and display that number. repeat looking at that picture until all pixels have been looked at, then download a new picture.

The latter. If you use the same seed you'd get the same sequences.

youtube.com/watch?v=MiuLeTE2MeQ

most random numbers are actually pseudorandom

which basically means just putting the current date through an algorithm that spits out a number

i'm pretty sure its almost all random, there are too many examples to list so i will just say the first that came to mind;

if you drop some salt on the floor, and then do it again, it will never be exactly the same position/amount of salt/degrees/angles/distances from other grains of salt. you could try to match the exact conditions that you first used and it still wouldnt be the same.

but also other stuff, like no human will ever be alive again, its random, you cant have hitler then another exact hitler born 200 years later

>tfw 3d loli FBI agents are trying to get your dick hard

Sensitive to starting conditions != randomness
It's still just straight causality.
Randomness is the half life of an atom.

>Randomness is the half life of an atom.
can you explain this user? i dont understand

found you thru google images

37

none, assuming random is a uniform distribution

Radioactive decay is a stochastic (i.e. random) process at the level of single atoms, in that, according to quantum theory, it is impossible to predict when a particular atom will decay.

Instead people just use the halflife, which is, if we have 1 Billion atoms, how long would it take for half, on average, to decay.

Basically, filliping a coin is random, but if you flip a billion coins, you can expect 500 million heads.

What does based Terry A. Davis say about random numbers tho? Does God make them randomized or what?

at an atomic level thats not random either, electron capture for example depends on the movement of the electron within the particle

Yes, and God can manipulate random numbers to gives you messages.

What does that have to do with nucleus decay with IS random

He says a nigger can't understand random numbers

But are we sure that radioactive decay is truly random or is it just that science has not found a way to predict it yet ?

1:30 in youtube.com/watch?v=denb9xfddZs

Why dont those stupid atheist niggers get random numbers?

me blinking is also random then, it just depends on how im moving right now

I just flipped a coin 10 times and i didn't get heads 5 times.

Do you even math bro?

Now do it 100000 times

Oh sorry I meant to say 10 coins. I literally have 10 coins right now on me

Itt: high school freshman trying to be witty

Just flip them over and over again, and the more you do it the more likely the numbers are gonna tend to 50/50

The chance of getting exactly 5 heads when flipping 10 coins is only 25%.

Entropy. There exists two macrostates: dubs and no dubs. The no dubs macrostate has more many more microstates (90/100) than the number of microstates for dubs (10/100). Despite dubs having low entropy and no dubs having high entropy, every single microstate is equally likely, yet getting dubs is less common because there are a lot less microstates for dubs.

checkem

...

Now add up both n6mbers and see wtf you get

AA88B8AB

Not even dubs?

Don't feel too bad. Your non dubs are just as rare as someone else's dubs :^)

It's just hashing the date and time.

post yfw you realize that whoever created this gay universe is a motherfucking gambler that needs rehab

So all this got me wondering. Is trying to write a program to guess lotto numbers inherently pointless as well?

>CIA nigger
That's like calling someone a Jewish nazi, fucking stupid

A seed generates pseudorandom numbers

At uni we used arduinos antennae noise to scramble numbers even more

Check out this very well developed psudo random number generator. The comments describe what is going on in the code.

pell.portland.or.us/~orc/Code/Misc/random.c

that's the problem with randomness
you can prove something isn't random, but not that it is