Skip to main content

Generation and Testing of Random Numbers

  • Chapter
Book cover What Is Computer Science?

Part of the book series: Undergraduate Topics in Computer Science ((UTICS))

  • 3284 Accesses

Abstract

The concept of randomness is quite abstract: what does random even mean, when can we describe a number as random, and what can random numbers be used for? Although we might have an intuition about such questions, the central role of random numbers in cryptography (e.g., as key material) demands care via more formal treatment.

This forms motivation for the chapter, whose goal is to provide answers in two main parts. First it explores metrics for differentiating between random versus non-random (or ”good” and ”bad” randomness); various simple experiments to generate and test random numbers provide practical evidence. It then introduces the concept of pseudo-randomness, which unlike real randomness can be generated by algorithms such as the Linear Congruential Generator (LCG).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 49.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Using cat here is a bit awkward: we do so simply to show this example within the same BASH-based setting as the others. An easier way to create P.sh might of course be to use a text editor.

References

  1. Wikipedia: Any key. http://en.wikipedia.org/wiki/Any_key

  2. Wikipedia: Bayes theorem. http://en.wikipedia.org/wiki/Bayes’_theorem

  3. Wikipedia: Coin flipping. http://en.wikipedia.org/wiki/Coin_flipping

  4. Wikipedia: Data Encryption Standard (DES). http://en.wikipedia.org/wiki/Data_Encryption_Standard

  5. Wikipedia: Gambler’s fallacy. http://en.wikipedia.org/wiki/Gambler’s_fallacy

  6. Wikipedia: Geiger counter. http://en.wikipedia.org/wiki/Geiger_counter

  7. Wikipedia: Kolmogorov randomness. http://en.wikipedia.org/wiki/Kolmogorov_randomness

  8. Wikipedia: Linear Congruence Generator (LCG). http://en.wikipedia.org/wiki/Linear_congruence_generator

  9. Wikipedia: Magic number. http://en.wikipedia.org/wiki/Magic_number_(programming)

  10. Wikipedia: National lottery. http://en.wikipedia.org/wiki/National_Lottery

  11. Wikipedia: “Nothing up my sleeve” number. http://en.wikipedia.org/wiki/Nothing_up_my_sleeve_number

  12. Wikipedia: Press Your Luck. http://en.wikipedia.org/wiki/Press_Your_Luck

  13. Wikipedia: Pseudo-randomness. http://en.wikipedia.org/wiki/Pseudo_random

  14. Wikipedia: Randomness. http://en.wikipedia.org/wiki/Randomness

  15. Wikipedia: Script. http://en.wikipedia.org/wiki/Script_(computing)

  16. Wikipedia: Statistical randomness. http://en.wikipedia.org/wiki/Statistical_randomness

  17. Wikipedia: /dev/random. http://en.wikipedia.org/wiki//dev/random

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Page, D., Smart, N. (2014). Generation and Testing of Random Numbers. In: What Is Computer Science?. Undergraduate Topics in Computer Science. Springer, Cham. https://doi.org/10.1007/978-3-319-04042-4_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-04042-4_7

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-04041-7

  • Online ISBN: 978-3-319-04042-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics