Using Random Numbers to Create a Histogram



Histograms are used to to help visualize the relative frequency of a set of possible outcomes for an event.

In this problem we are going to simulate the rolling of a pair of dice 1000 times.

We are going to roll 2 dice and then record the sum of the dice. Create an int array of size 13 (we won't use first 2 spots). Every time you generate a sum, increment the value in your array at ar[sum]

Print out the probability that each sum occurs. It will print out something like :

2 : 8.2%
3 : 12.4%
etc.