Coding Math: Episode 51 - Pseudo Random Number Generators Part I

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ธ.ค. 2024

ความคิดเห็น • 56

  • @notbarbara2647
    @notbarbara2647 5 ปีที่แล้ว +45

    Wow, this video deserves way more views. This was an awsome + visual explanation. Thanks for taking the time to make this video

  • @maskedjiro1271
    @maskedjiro1271 5 ปีที่แล้ว +15

    Your voice is just perfect for these kind of videos!!!

  • @PixelOutlaw
    @PixelOutlaw 8 ปีที่แล้ว +9

    This is especially useful when you are working with small languages like Scheme which by default do not provide a random number generator.

  • @stefanodomeni
    @stefanodomeni 2 ปีที่แล้ว +3

    Why is it so difficult for professors to just teach like this in school

  • @kriszenn1125
    @kriszenn1125 6 ปีที่แล้ว +2

    Wow! I could use this for a one-time pad encoder and decoder. Since the middle squares method repeats more often, it's probably the right choice because I could send that sequence to another person using one number (seed), and they can decode my message!

  • @brutalmustache9533
    @brutalmustache9533 6 ปีที่แล้ว +1

    Thanks a lot! This video made the PRNG algorithm much clear for me.

  • @ngroy8636
    @ngroy8636 4 ปีที่แล้ว +2

    13:37 : are you saying that you can see repeats in a higher dimension? can you emphasis on that idea? Thank you!

  • @rismorismo
    @rismorismo 10 หลายเดือนก่อน

    So good presentation!!! Thanks!

  • @DxBALLxD
    @DxBALLxD 4 ปีที่แล้ว

    Thanks man this explanation has been stellar. I've been wanting to get a grip on procedural generation for a while and only heard vague horror stories about recursive loops and such throwing the organic look off completely. Now I know some official terminology to look out for

  • @kushclient5010
    @kushclient5010 2 ปีที่แล้ว

    a "TRNG" using light is more of just a "CRNG" for a like chaotic random number generator, because it's just something so unpredictable it's hard to figure out. If you had the same light with everything being the same, it would give the same response. hence it not being a true random number generator.

  • @benjamindeworsop8348
    @benjamindeworsop8348 6 ปีที่แล้ว +1

    brilliant and clear video - super helpful

  • @Kokurorokuko
    @Kokurorokuko 3 ปีที่แล้ว +2

    I'm watching this with reversed colors so it isn't so bright and this dude says "it might go all black" @9:25 and I'm like "you trippin dawg, that's white"

  • @anwiseru9064
    @anwiseru9064 6 ปีที่แล้ว +2

    good presentation. i enjoyed the video!

  • @yimoawanardo
    @yimoawanardo 8 ปีที่แล้ว +2

    Very useful lesson ! Thanks !

  • @styleisaweapon
    @styleisaweapon 4 ปีที่แล้ว +3

    Did you really say that Linear Congruential Generators have bad distribution? They literally have perfect distribution in practice. Distribution isnt their flaw. Their primary flaw is that n-tuples of their sequence fall on simple linear n-dimensional hyperplanes. An improvement is to temper the output. The low period of the lower order bits isnt a flaw either. The flaw there is using the entire state. There is no known method of sequence generation that is more efficient than tempered LCG's that also performs better on statistical tests like bigcrush. It is now also known that elaborate chaining of LCG's, like in the case of the Mersenne Twister, is statistically inferior to simple tempered LCG's.

    • @KeithPeters
      @KeithPeters 4 ปีที่แล้ว

      This is an epic comment. Thanks!

  • @tantangurm
    @tantangurm 2 ปีที่แล้ว

    Awesome content. Kudos

  • @halvedbagel5827
    @halvedbagel5827 8 ปีที่แล้ว +3

    great video!
    thanks for sharing!

  • @issacthompson330
    @issacthompson330 3 ปีที่แล้ว +2

    Personally, I want to make an RPG where if the player wanted to, they could predict the RNG with a little effort as the number that affects the seed is a combination of all the character stats that are publicly available.

  • @kevnar
    @kevnar 5 ปีที่แล้ว

    If only we could harness the chaos of internet conspiracy theorists to seed a random number generator.

  • @EntangledFrequency
    @EntangledFrequency 8 ปีที่แล้ว +4

    Very useful! Particularly that starting to get into openCL and need a PRNG on GPU is important for what I want to do.

  • @MiserableDuck95
    @MiserableDuck95 4 ปีที่แล้ว

    How is it determined which of the generated seeds will be returned to the user as the "random number"

  • @GurlNamedBrettMarie
    @GurlNamedBrettMarie 4 ปีที่แล้ว

    What about an app that picks numbers 1 through 75 with 15 lines. How can I tell which line fills up first?

  • @vincentcleaver1925
    @vincentcleaver1925 4 ปีที่แล้ว

    This has been very helpful. I'm writing dirty JS in html pasted into my blog... 3js is not an option for me to do 'eeal' 3D, but I have been using '2 and a half' D and PR# for procedural world map generation etc. I wish you had a patreon, I'd like to pay you back

  • @NunyaBizznezz6969
    @NunyaBizznezz6969 ปีที่แล้ว

    I wanted random in minecraft.. Put a pressure plate in my cow pen. When the cow happens across it, feels pretty random

  • @morgansommers5238
    @morgansommers5238 2 ปีที่แล้ว

    can this be applied to MATLAB as well?

  • @mirriamjulile9738
    @mirriamjulile9738 2 ปีที่แล้ว

    How to find the Seed for the first time?

  • @subhashsarangi
    @subhashsarangi 6 ปีที่แล้ว +1

    How to do that pattern visualization in python3

  • @peter4210
    @peter4210 4 ปีที่แล้ว

    a true Random number can actually clump and give a set that is not close to the theological probability. PRNG are actually going to give something closer to the theoretical probability

  • @grimreaper5295
    @grimreaper5295 5 ปีที่แล้ว

    my question is how did you get those inputs to work. like how did the program you use understand what seed meant for the input value?

    • @johnmcdaniels9231
      @johnmcdaniels9231 4 ปีที่แล้ว +2

      seed is just a variable name.. it could have been anything. he was telling the program what to do with it

  • @GlennCrinerLA
    @GlennCrinerLA 6 ปีที่แล้ว +2

    do lottery machine use this??

    • @elucified8883
      @elucified8883 5 ปีที่แล้ว +1

      EXACTLY,,They do..
      If you somehow get to know about the parameters (multiplier, increment , modulus and seed) You might get to know about the winning lottery number as well.😁
      th-cam.com/video/aZbEF1aduok/w-d-xo.html

  • @gamesniper98
    @gamesniper98 5 ปีที่แล้ว

    what tool do u use

  • @peichen3332
    @peichen3332 7 ปีที่แล้ว +1

    Thank you sir

  • @Ozterkvlt
    @Ozterkvlt 7 ปีที่แล้ว

    shouldnt you be getting an overflow eventually working with an M the size of 2^31?

  • @kamoroso94
    @kamoroso94 8 ปีที่แล้ว

    Isn't the formula used in the Linear Congruential Generator similar to one you may use for hashing?

    • @KeithPeters
      @KeithPeters 8 ปีที่แล้ว +1

      Probably. My understanding of hashing is combining existing data with repeatable random data. Hash the same data with the same seed, you get the same result.

    • @Huststyler
      @Huststyler 8 ปีที่แล้ว

      Yes I've seen something similar except with bitwise operations and modulus.

  • @rockonyo100
    @rockonyo100 8 ปีที่แล้ว +2

    Awesome.Thanks :)

  • @johnconley4955
    @johnconley4955 3 ปีที่แล้ว +2

    Whenever I get stuck with something Math, I'm with Keith. So here I am again(⓿_⓿) at stupid o'clock. Hope you are well Keith

    • @hiranga
      @hiranga 3 ปีที่แล้ว

      i dont rly know how to code but I was wondering if there's a simple way to convert this into python?

  • @smashinglabu3942
    @smashinglabu3942 6 ปีที่แล้ว

    20, 8, 6, 15, 35, 6, 10, 5, 20, 23, 14, 28, 28.....

    • @inventor15
      @inventor15 5 ปีที่แล้ว

      Do you have more sample data?

  • @Maxime78Paris
    @Maxime78Paris 7 ปีที่แล้ว

    slot machines are based on pseudo random generators and "pseudo" because a machine that has a predefined payback rate to the players can by definition not be random. However if you're able to notice or being aware enough to understand that you re in a repeating cycle (bad cycle) then would you be able to apply it to slot machines by leaving a slot machine for another hoping for better winning odds based on the fact that you just left a loosing slot machine (repeating loosing cycles) for another machine that could possible be in a good cycle ? therefore you d have saved money by not feeding a machine that would not have given anything back from the cycle ?

  • @jakobb.4214
    @jakobb.4214 2 ปีที่แล้ว

    cool video

  • @bryan8r237
    @bryan8r237 2 ปีที่แล้ว

    you hacked the eddie

  • @bluenation989
    @bluenation989 6 ปีที่แล้ว +1

    Sir please can I get your email

  • @keithwallace5277
    @keithwallace5277 6 ปีที่แล้ว

    subscriiiiibing

  • @kebekbutcher
    @kebekbutcher 4 ปีที่แล้ว +1

    3:08 so we won't talk about the real RNG??? WTF is this video...

    • @kebekbutcher
      @kebekbutcher 4 ปีที่แล้ว

      I am still watching the rest of the video, but wtf at that point... I had to make that comment, let's see what is next...

    • @theboiyoulove5124
      @theboiyoulove5124 4 ปีที่แล้ว

      @@kebekbutcher Bro real RNG's are dependant on the hardware.
      What i meant by that is that there is some kind of special hardware which detects various things like the temperature the radioactive waves etc. These numbers are random,using this they create truly random numbers.
      Hope that helps!

  • @pustai1627
    @pustai1627 3 ปีที่แล้ว

    I was the like #999 :(( but super usefull vid