title: Dice rolling outputs
body: <p>I have finished this code but I need help understanding why the outputs aren't the same as desired. Here is my code. Also my professor said to use a seed of 237.</p>
  
  <pre><code>import random
  rng = random.Random()
  rng.seed(237)
  
  NumberOfRolls = int(input("How many dice?:"))
  NumberOfFaces = int(input("How many sides of each dice?:"))
  numberOfTrials = int(input('How many trials? Enter:'))
  
  # Set the number of elements in the list
  #def throwDice():
  def throwDice(NumberOfRolls):
      return random.randrange(1,NumberOfFaces)
  
  def rollAllDice(NumberOfRolls):
    sum = 0;
    for i in range(NumberOfRolls):
      v = throwDice(NumberOfRolls);
      sum = sum + v;
      # print(v);
    return sum;
  
  
  
  # perform simulation, record and print frequencies
  index = (NumberOfRolls*NumberOfFaces)+1;
  frequency = [0]*index
  rel_frequency_list = [0]*index
  exp_prob_list =[0]*index
  
  for i in range(numberOfTrials):
    ind = rollAllDice(NumberOfRolls);
    frequency[ind] = frequency[ind]+1;
  # end for
  print()
  #print("Frequencies:")
  
  
  
  # calculate relative frequencies, probabilities and errors
  relativeFrequency = [0, 0]
  probability = [0,0]
  error = [0,0]
  for i in range(2, len(frequency)):
    rel_frequency_list[i] = frequency[i]/numberOfTrials;
    exp_prob_list[i] = frequency[i]/100;
  
  
  #print(relativeFrequency)
  #print(probability)
  #print(error)
  print()
  
  
  # print results
  f1 = "{0:&lt;10}{1:&lt;22}{2:&lt;22}{3:&lt;22}"
  f2 = 71*"-"
  f3 = "{0:&gt;3}       {1:&lt;22.15f}{2:&lt;22.15f}{3:&lt;.15f}"
  print(f1.format("Sum","Frequency","Relative Frequency","Experimental Probability"))
  print(f2)
  for i in range(NumberOfRolls, len(frequency)):
     print(f3.format(i, frequency[i], rel_frequency_list[i], exp_prob_list[i]),"%")
  #end for
  </code></pre>
  
  <p>This is my output for 3 dice , 6 sides, 10,000 trials</p>
  
  <pre><code>Sum       Frequency             Relative Frequency    Experimental Probability
  
  -----------------------------------------------------------------------
    3       75.000000000000000    0.007500000000000     0.750000000000000 %
    4       232.000000000000000   0.023200000000000     2.320000000000000 %
    5       454.000000000000000   0.045400000000000     4.540000000000000 %
    6       831.000000000000000   0.083100000000000     8.310000000000000 %
    7       1214.000000000000000  0.121400000000000     12.140000000000001 %
    8       1468.000000000000000  0.146800000000000     14.680000000000000 %
    9       1491.000000000000000  0.149100000000000     14.910000000000000 %
   10       1445.000000000000000  0.144500000000000     14.449999999999999 %
   11       1157.000000000000000  0.115700000000000     11.570000000000000 %
   12       828.000000000000000   0.082800000000000     8.279999999999999 %
   13       476.000000000000000   0.047600000000000     4.760000000000000 %
   14       230.000000000000000   0.023000000000000     2.300000000000000 %
   15       99.000000000000000    0.009900000000000     0.990000000000000 %
   16       0.000000000000000     0.000000000000000     0.000000000000000 %
   17       0.000000000000000     0.000000000000000     0.000000000000000 %
   18       0.000000000000000     0.000000000000000     0.000000000000000 %
  </code></pre>
  
  <p>This is the desired (same outputs):</p>
  
  <pre><code>Sum Frequency Relative Frequency Experimental Probability
  ----------------------------------------------------------------------
   3 45 0.00450 0.45 %
   4 126 0.01260 1.26 %
   5 281 0.02810 2.81 %
   6 494 0.04940 4.94 %
   7 677 0.06770 6.77 %
   8 968 0.09680 9.68 %
   9 1191 0.11910 11.91 %
   10 1257 0.12570 12.57 %
   11 1257 0.12570 12.57 %
   12 1164 0.11640 11.64 %
   13 932 0.09320 9.32 %
   14 683 0.06830 6.83 %
   15 469 0.04690 4.69 %
   16 282 0.02820 2.82 %
   17 122 0.01220 1.22 %
   18 52 0.00520 0.52 %
  </code></pre>