do not click

Meeting C++ 2025   |  Online   |  Training   |  Books   |  Survey   |  Job fair   |  Advertising   |  Jobposting   |  Login

Meeting C++ 2025 - What is a random number and why should I care?

Conference | Live Schedule | Talks | Get your ticket | Slides | Set your timezone

What is a random number and why should I care?

Join session

Books by Frances Buontempo

Learn C++ by Example

Frances Buontempo

On Day 3 at 9:00 (CET/Berlin) in Track C [Jade Room and online]

How can a deterministic function possibly give random results? We will find out and learn how to use various random number distributions.

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 when shuffling, sampling and even seeding when using random number generators.


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. 

By the end we’ll be familiar with terms like pseudorandom number generator (PRNG), linear congruential generator and random number distributions. 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.

Please login to comment

Copyright Meetingcpp GmbH Imprint Privacy Policy