problem0(): Carry out the middle square random number sequence. 0 : 3647 1 : 3006 2 : 360 3 : 1296 4 : 6796 5 : 1856 6 : 4447 7 : 7758 8 : 1865 9 : 4782 10 : 8675 problem1(): Estimate pi in two lines of code. pi_estimate = 3.13192 problem2(): Given 0 <= d < 365, day of year print month and day of month. Use d=68 which should be March 10. The calendar date is March 10 problem3(): given card index c, identify rank and suit. Card index c = 29 Card 29 is Four of Diamonds problem4(): Newton-Pepys dice problem Process 1: 6 dice are rolled, does at least 1 six show? Process 2: 12 dice are rolled, does at least 2 sixes show? Process 3: 18 dice are rolled, does at least 3 sixes show? Process 1 probability estimate = 0.667 Process 2 probability estimate = 0.635 Process 3 probability estimate = 0.591 problem5(): Probability of a straight in poker. Estimated probability of a straight is 0.00353 Theoretical value is 0.003940037553482932 problem6(): Probability of a flush in poker. Estimated probability of a flush is 0.00226 Theoretical value is 0.001965401545233478 problem7(): shared birthdays among a group? There were 24 unique birthdays in group of 25 people. problem8(): Stop having children after first boy. Total kids born = 1915 Total girls born = 915 Total boys born = 1000 Maximum family size was 11 Average family size was 1.915 problem9(): How long does a random sequence stay monotone, on average? Tested 10000 sequences Average length of monotone sequence = 2.719 Theoretical value is 2.718281828459045