include random

Formal education

Mathematics

At the university I had a few class, which touched the topic about random, and I do not mean some pseudo-random, rather from the pure abstract mathematical point of view. We had our fun at that time.

IT

Of course at computer science classes we had random number generator, or did we ?

I had an exam, where we must wrote multi-threaded application in Ada language. It was some kind of simple producer, consumer problem, the only part I was lacking to generate a random number. I have totally forgot how to do it in Ada, and we cannot use any manual or help for the exam. At that point either I could fail the whole exam, or cheat (That is something I disliked at university.)

In the end I came up with a rather error-prone random number generator:

  return 4;

At least it compiled, and I could finish the important part of the exam.

<random>

This is a nice extension of the standard C++, while I can write code and still think I am a math person. You can watch a nice presentation about the library.

Click on the picture to watch!