How do random number generators work? | Random Numbers

Поделиться
HTML-код
  • Опубликовано: 5 сен 2024
  • There is nothing truly random when it comes to computers. Computers do what they are told to do. In this video, we cover all about random numbers, pseudo-random numbers, and random number generators. After watching this video, you will be able to answer the below questions:
    - What are random numbers?
    - What are random number generators?
    - What are pseudo-random numbers?
    - How do random number generators work?
    - What is the initial seed?
    - Why is it important to pick a good initial seed?
    Channel website:
    - roadmap.sh
    Discord Community:
    - / discord
    Find us on the internet:
    - / roadmapsh
    - github.com/kam...
    - / roadmapsh

Комментарии • 65

  • @RijoBeats
    @RijoBeats 2 года назад +39

    These digestible sessions are pretty cool

  • @FuryOutlaw
    @FuryOutlaw Год назад +11

    Thank you for the concise and straightforward content!

    • @Imisambi
      @Imisambi 4 месяца назад +1

      gooooood stufffffffffffffff!!

  • @Simp_Zone
    @Simp_Zone Год назад +9

    Tres interesting... Was watching a video about quantum entanglement and the idea of randomness just seems strange to me. Like surely nothing can be truly random if all variables are known? Now I'm sounding deterministic lol.

    • @AdrianCosman
      @AdrianCosman 7 месяцев назад

      Nothing wrong with determinism, just embrace it

  • @superfit2707
    @superfit2707 8 месяцев назад +19

    How can it be random if we are seeding the initial number - machine should know that it has to generate a random number but it should decide the numbers on its own - in that way we can truly call it as random number generator

    • @alolosbasha
      @alolosbasha 7 месяцев назад +5

      The initial seed could be the time of day for example
      Check vid at end it is stated

    • @geanluiz100
      @geanluiz100 7 месяцев назад +3

      Have You actually watched the video?

    • @aarynforehand3130
      @aarynforehand3130 6 месяцев назад +3

      The computer doesnt think....it can only do what it is told.

    • @letsdiscussitoversometea8479
      @letsdiscussitoversometea8479 6 месяцев назад +4

      The computer determines the initial seed dependent upon variables which have been determined before the RNG instruction is executed.
      So for example, a given number of milliseconds may have passed inside the computer's internal clock, which would therefore consist of the number of the specific initial seed.
      Put even more simply, let's say that 1,494 milliseconds have passed since the computer booted up and was ready to accept instructions from the user;
      1,494 milliseconds, could produce an initial seed, of, say, 646.
      Were it 1,495 milliseconds, then the computer could produce an initial seed, of, say, 71.
      1,496 milliseconds, could produce an initial seed, of, say, 50935.
      All predetermined numbers as far as the manufacturer programmed-in initial seed might happen to be, but certainly not clearly noticeable to the person using the computer.
      If - just by astonishingly incidental chance the next time you booted the computer up, and took 1,494 milliseconds to execute an RNG instruction, the initial seed would - once again - be the hypothetical 646 given in the above example.
      In other words, it is ultimately fixed, and isn't *_truly_* random, no.
      But it is *_virtually_* random as far as the *oblivious* end user is concerned.
      And now that you know, you're technically just that little bit *_less_* oblivious, and could try to repeat the experiment, to see how the RNG instruction works on a given computer.

    • @pihlajafox
      @pihlajafox 3 дня назад

      It can't give you a random number without rng

  • @sadiasayed3917
    @sadiasayed3917 2 года назад +6

    this so underatted i swear

  • @shri5248
    @shri5248 7 месяцев назад +3

    Got clarity. Thanks a lot.

  • @florianwege7563
    @florianwege7563 2 года назад +8

    I thought the "seed" only denotes the starting value as in you plant a tree and is thus not dynamic for different iterations of the same RNG. The current state could also be a function of multiple previous states. Furthermore, each iteration could depend on some exterior parameter like the temperature. But more importantly, it could be stated that the distribution of the output values of an RNG is not necessarily even, good statistical properties are a quality characteristic of an RNG. Lastly, the Pseudo RNG as a model could be contrasted to True RNGs and Cryptographically Secure Pseudo RNGs.

  • @Nabil_Khori
    @Nabil_Khori 11 месяцев назад +2

    Thanks this is do easy to understand u gained new subscriber

  • @chaine218
    @chaine218 8 месяцев назад +1

    Very helpful video, Thank you!

  • @siddharthrana8525
    @siddharthrana8525 10 месяцев назад +3

    thanx buddy 🎉 but i have a quetion for you ? if we have only random numbers from 1 to 99,00. so how can we find seed or anything for predicte the next number.

    • @letsdiscussitoversometea8479
      @letsdiscussitoversometea8479 6 месяцев назад

      By ultimately establishing every single parameter that the computer works on to determine the initial seed...
      However, such a feat would require several billion generations of several world populations' entire lifetimes, just to reach what is - ultimately - still technically possible.
      Because everything in computing is binary (i.e consisting of 1s and 0s), there will DEFINITELY be a point where this can be established.
      Whether or not you're up to _trying,_ is still your free choice I suppose! 🙂

  • @MutairuW.O
    @MutairuW.O Месяц назад

    Great explanation 😊😊

  • @mirriamjulile9738
    @mirriamjulile9738 2 года назад +5

    Sir if I may ask, How to get the Seed as well as that percentage you used?

  • @pineapplejuice1156
    @pineapplejuice1156 2 года назад +1

    Interesting. Thank you for the explanation

  • @The_Ancient_Guardian
    @The_Ancient_Guardian 2 года назад +1

    escelent video, thank very much.

  • @6up5ohcopoutprocon
    @6up5ohcopoutprocon Месяц назад

    THANK YOU!!

  • @sharathpujari6364
    @sharathpujari6364 11 месяцев назад +1

    How is the formula used to calculate

  • @noobicon4118
    @noobicon4118 5 месяцев назад

    What if I used random function giving the range 10 and it generates a value let's say 6 so when refresh it and use random function again giving range 10 will it give same value again?? Because it's using a specific formula which would give us the value

  • @mustaphaatiku2165
    @mustaphaatiku2165 Год назад

    Very perfectly explained

  • @SaumyaSharma007
    @SaumyaSharma007 2 года назад +1

    Awesome 😎👍 Thanks

  • @roberthutchison8197
    @roberthutchison8197 Год назад

    I have a thought on how to choose a random number. Why not use the value of Pi? As we know, Pi has NO resolution and so print out a couple of pages of those numbers and pick some!

    • @ArtyukhovBogdan
      @ArtyukhovBogdan Год назад

      How do you know which ones to choose? Another PI? Recursive, isn't it?)

    • @roberthutchison8197
      @roberthutchison8197 Год назад

      @@ArtyukhovBogdan Isn't that the idea, if you don't know, how will anyone else!

  • @nicolasleite8519
    @nicolasleite8519 Год назад +4

    last 20 seconds were the most clarifiers, lol

  • @FoneysAdventures
    @FoneysAdventures 4 месяца назад

    It would be better if you added the past seed to the next seed if it repeats

  • @bahavamuru8354
    @bahavamuru8354 7 месяцев назад

    Thanks master,I win 200RM in Malaysia 4d lottery

  • @eslam_faris
    @eslam_faris Год назад +1

    Is there is any tool to put the numbers and getting the results?

    • @letsdiscussitoversometea8479
      @letsdiscussitoversometea8479 6 месяцев назад

      You could simply write a machine code program which instructs the computer to display the given numbers using something like the PEEK command I suppose (but PEEK is a BASIC instruction, not a straightforward machine code instruction).

  • @rasmusleddyr
    @rasmusleddyr 2 года назад +3

    What is the math you use here?
    By any way I can think of setting up this equation, "381 * 82 % 12" would always equal 3749.04, never 6.
    381 * 82 = 31242
    31242 % 12 = 3749.04
    To get 6, you'd need 50% of 12, not 31242% of 12.
    Also, how does a process like this give pseudo-random numbers?
    If you use the old output as the new input, the new output would always be greater than the old output, you would never get a smaller number.
    Maybe I am just missing something here?

    • @roadmapsh
      @roadmapsh  2 года назад

      It was just an example, I did not put the actual math equation to keep things simple. Have a look at this article www.freecodecamp.org/news/random-number-generator which has an example equation as well.

    • @rasmusleddyr
      @rasmusleddyr 2 года назад

      @@roadmapsh Alright. I read through that article before watching your video.
      I was having a hard time understanding the article though, so I thought it would be easier to find a video where a voice explains it, but so far I haven't found one that shows and explains a real example of how the math works. :-(

    • @keonscorner516
      @keonscorner516 Год назад +1

      The % is the reminder after dividing

    • @Inwbpwns4evr
      @Inwbpwns4evr Год назад +1

      % means the modulus (or “remainder”) between two numbers.
      85%12 is the same as writing 85 mod 12
      What you do first is divide the numbers
      85/12= 7.083
      Now we see that 7*12 is the last whole multiple before we hit 85.
      Therefore the modulus or the “remainder” will be
      85-(7*12)=85-84=1
      So we can now say that
      85%12 (85 mod 12) = 1
      A simpler example would be 7%3 = 1 or 9%7 = 2
      Hope this helps! ◡̈

    • @nowfalnoushad5214
      @nowfalnoushad5214 17 дней назад

      381*82%12=6?

  • @gautamthulasiraman18
    @gautamthulasiraman18 2 года назад

    Thanks man ❤️. You saved me..

  • @pankajroshan2617
    @pankajroshan2617 11 месяцев назад

    Really nice video.

  • @udaykirangarlapatti1622
    @udaykirangarlapatti1622 Год назад

    U got a subscriber

  • @siddhuyarragani7742
    @siddhuyarragani7742 2 года назад +1

    The random numbers are 4, 2, 21, 7,1,28 can please tell me sir how???

    • @Inwbpwns4evr
      @Inwbpwns4evr Год назад +3

      % means the modulus (or “remainder”) between two numbers.
      85%12 is the same as writing 85 mod 12
      What you do first is divide the numbers
      85/12= 7.083
      Now we see that 7*12 is the last whole multiple before we hit 85.
      Therefore the modulus or the “remainder” will be
      85-(7*12)=85-84=1
      So we can now say that
      85%12 (85 mod 12) = 1
      A simpler example would be 7%3 = 1 or 9%7 = 2
      Hope this helps! ◡̈

  • @lamer8310
    @lamer8310 Год назад

    banger

  • @harsh9558
    @harsh9558 5 месяцев назад

    Interesting

  • @killamaita
    @killamaita 2 месяца назад

    The reason dice don't roll the same is because they are perfectly rigged but we roll them different and we roll them different because we are perfectly rigged to want randomness no matter what!

  • @valorantshorts3539
    @valorantshorts3539 2 года назад

    awesome

  • @ddphotospalani299
    @ddphotospalani299 Год назад

    Any idea

  • @TransformativeMind
    @TransformativeMind 4 месяца назад

    Trying find edge on bovada

  • @wahyoetube406
    @wahyoetube406 2 года назад +4

    Am I the only Person, think how this work in LOTRE System??? 🤔

  • @shiel1
    @shiel1 17 дней назад

    bro forgot about 3 (0:54)

  • @pikazap6672
    @pikazap6672 3 месяца назад

    my friend once told me im like a random generator of words. now at least I know how I function unlike him.

  • @neeshu
    @neeshu 2 года назад

    I would have a for loop run from 1-100 and stop a clock after every 1-2 milliseconds and get a new random number

  • @songdjbaba824
    @songdjbaba824 2 года назад

    Teen patti game how to random number work

  • @songdjbaba824
    @songdjbaba824 2 года назад

    Hii

  • @Decent9669
    @Decent9669 9 месяцев назад

    RANDOM NUMBER

  • @vibhordwivedi5070
    @vibhordwivedi5070 6 месяцев назад

    Well explained, must watch video❤