This is a simple coin flip maths operation. In this case, you can click on the coin to flip it, and it will either land on a heads or tails. This is simple probability, because you have a 1/2 chance of getting a heads or tails.
This is what I call a Copy Code, so you can copy this code (please add credit) and use it as your own. OK I KNOW IT'S BAD DON'T JUDGE