ACCU Membership: [ Ссылка ]
[ Ссылка ]
[ Ссылка ]
Using, Generating and Testing with Pseudo-Random Numbers - Frances Buontempo - ACCU 2023
Slides: [ Ссылка ]
How can a deterministic function possibly give random results? We will find out and learn how to use various random number distributions. We will also discover another way to code ourselves out of a paper bag in the process.
Most of us need a random number at some point if we write code. We will discover how they are generated. We will see how to ensure simulating a dice roll makes the numbers 1 to 6 equally likely, and note some pitfalls to be aware of in some programming languages.
We will have a brief aside into stochastic outcomes from deterministic models, also known as chaos. Applying a function iteratively can’t possibly give non-deterministic results, right? We shall see.
After this aside, we will return to using random numbers. We will consider more complicated situations, such as requiring numbers distributed around an average and how to generate with specific properties, such as being prime. To round off, we will think about how to test code using random numbers.
By the end we’ll be familiar with terms like pseudorandom number generator (PRNG), linear congruential generator and random distribution. Finally, we’ll use various distributions to race some blobs out of a paper bag. Seeing a visual demonstration will solidify some the learning outcomes.
---
Frances Buontempo
Frances Buontempo is currently editor of the ACCU’s Overload magazine and has written a book on Genetic Algorithms and Machine Learning [[ Ссылка ]]
She has worked as a programmer at various companies, mostly in London with a focus on finance. She enjoys testing and deleting code and tries to keep on learning.
---
YouTube Videos Filmed, Edited & Optimised by Digital Medium: [ Ссылка ]
#accuconf #Cpp #Python
Ещё видео!