Enter the stats.html text from Figure 11.7 into a new Web page, then load the page in

Question:

Enter the stats.html text from Figure 11.7 into a new Web page, then load the page in the browser to verify that it behaves as described.

Add an additional text span to your stats.html page that serves as a conditional counter, keeping track of the number of times the user rolls doubles. The new SPAN element should appear below the existing one that displays the number of rolls, and should be preceded by an appropriate label. Within the RollDice function, add an if statement that checks whether the two rolls are identical and, if so, increments the doubles counter in the text span.

Statistically speaking, users should obtain doubles on 1/6th their rolls. This is attributable to the fact that 6 out of the 36 possible dice combinations are doubles. After a reasonable number of rolls, is your doubles count roughly one-sixth of the total number of rolls?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: