00:01
So you have a driver's test and you know that when you hear that 34 % of the candidates will pass on the first time and so that means that 66 % will fail and then these that pass won't take another test but these have a higher rate of now passing the second time.
00:19
If there's a 72 % chance of passing and then there is a 28 % chance of failing.
00:26
Now you want to create a plan for simulation to estimate the average number of time of drivers that it takes in order to pass the test and then again we would continue to go here if you fail you get 72 % chance of passing and then here and so this could continue on where this branch keeps going.
00:55
So what we do is we could start out with generating a random number and have rand int and generate numbers from 1 to 100.
01:11
Whoops 1 comma 100 and let's get rid of that little space and this will be the first attempt and then we will let 1 through 34 stand for you pass and then means it took one time and we'll let 35 through 100 stand for fail and then after that if it's a fail then you use rand int again of 1 to 100 however this time we're gonna let 1 through 72 stand for a pass and 35 excuse me 73 through 100 stand for a fail and then if it's a fail if it's a pass here then it takes two attempts here it takes one attempt and here it would end up being continuing on if this then you continue repeat number two until you get a p.
02:26
Now it says use the results to find the average number and to do a number of trials and you may have a slicker way of doing this but i would have to keep hitting that rand int and then keep track of trials.
02:38
So i'm going to get that feature on my calculator rand int and i'll tell you what my first result is my first result and let's change to blue my first trial one i have a 44 which means that i did not pass so now i have to hit the button again and the second number is a 17 which means it took two attempts to pass.
03:07
Second trial hit the button again we have 35.
03:12
35 is not passing so we need to have another number and we have 50 and that is a pass.
03:19
Third trial hit the number i get 96 which means didn't pass and then hit 75 and once again didn't pass...