an example of working with the random numbers and the blockchain. two solidity files are a library and a contract, and a python script (by the way it works) tests the possibilities
the purpose of the randomArray function is to generate random numbers in the range 0..4 with a given probability.