
Stanton D. answered 02/13/17
Tutor to Pique Your Sciences Interest
I'll solve for the general case first below, then sketch what to do for a discrete-rolls result.
Myself, I'd prefer to set up the initial probability in terms of NOT ROLLING a 4. That's (5/6)*(5/6) = 25/36. As Jason notes, that's equivalent to a 11/36 probability of rolling at least one 4 (per trial).
The incremental_value (for the desired statistic, number of trials required) of getting to that row is then the probability of getting there, times the row number (you've rolled the number of times equal to the row number). So for row 1, it's (11/36)*1; for row 2, (25/36)*(11/36)*2; for row 3, (25/36)^2 * (11/36) * 3, and so on.You may now (after 60 rows, for example -- that is, you rolled 60 times or until you had a "hit", for each trial) assess the data of this probability function. The overall probability of having gotten a 4 is the sum of the incremental probabilities, but the overall expected number of rolls required is the sum of the incremental_values (well, actually, the residual probability of failure *60 should also be added). The incremental probabilities (spread over the domain of 1 - 60 trials) are the appropriate data to analyse for variance of the number of rolls required (again, with the last incremental probability adjusted, since the problem didn't say "if you succeed, how many rolls....").Now, if you consider this as a simulation problem, there are two ways to go about it. You could "roll" the dice in a loop program and report back out the number of rolls required (the inefficient way!), or you could go about doing it mathematically (efficiently!). To do the latter, first, partition your domain into how ever many "maximum rolls" you want to perform -- let's say 100. You have to assign a cut-off, otherwise you might go on rolling forever! Next, examine the properties of the "incremental probability" function above. Generate two random numbers, the first scaled to run as integers from 1 to your maximum number of rolls. Suggestion = int(RND*maxrolls + 1) . Keep track of this number; it is the number of rolls you have performed IF you accept the value. Next, compare the second random number, scaled up so as to include the range (0,max_incremental probability), to the value of the incremental probability at that domain point. If the scaled second random number is <= the incremental probability, then accept the domain value, and add it as a new member to a set of accepted values. Keep track of how many values you have accepted. When you have your target number of data, stop generating data and analyse them in conventional manner.This may appear (and be) inefficient for a probability distribution that "falls off" abruptly, but it handles all sorts of distributions nicely WITHOUT the problems of programming multiple dice rolls.Incidentally, you should be calculating the incremental probabilities as a set only once on the spreadsheet, and comparing to the appropriate cell of these values when you do the test for acceptance of each prospective datum. If you have some Excel programming experience, you might recognize the utility of doing the data generation within a "macro" program on your spreadsheet -- that way, you can input the domain limit and the number of target data and (F5) or whatever starts your macro. Maybe even set up as a displayed graph to show your accumulating data!I have no idea what "experimental results" are being referred to as a "mathematical expectation of using". Perhaps they mean the number of accepted data, divided by the total number of rolls performed. Perhaps not!

Stanton D.
02/13/17