Hi everyone!
Is there anyone that can help me?
1- If I want to write a function(x) that takes (in this order) a and b as arguments and that returns the number of required divisions. (Example: a = 5,b = 2. Then we have: 5/2 = 2.5 (1 division), 2.5/2 = 1.25 (2 divisions), 1.25/2 = 0.625 (3 divisions), 0.625/2 = 0.3125 (4 divisions), 0.3125/2 = 0.1562 (5 divisions, result still not smaller than 0.1) and finally 0.1562/2 = 0.078125 (6 divisions, now the result is smaller than 0.1). In this case, the answer would be 6)
2- How many times do you have to roll the dice until you are allowed to start? The trial when you get 6 also counts. So if you roll for example 4, 2, 3, 1, 6 the number of trials and the answer would be 5.
Write a function(x) , that takes no input argument and returns the number of tries you need to obtain a 6.
Thanks