- #1
angeliKITTYx
- 8
- 0
Homework Statement
- Calculating the factorial of a number N
- For simulating the roll of a die 200 times (include the calculation for the relative frequency of the number 4 in the upface of the die within the 200 rolls)
Homework Equations
None?
The Attempt at a Solution
I am taking this class online and I am far from understanding pseudocode...
For example, if N was 7...
Set N to 7
Set M to 0
While (N>=M)
X = N - M
M = M+1
X = X(N - M)
M = (M+1)
This almost works, but the loop doesn't multiply ALL of the terms together... it just moves down the line of terms.
Second one:
Set roll to 1
While roll =< 200
Roll the dice
Read the upface of the dice
Set roll to roll + 1
Not sure about the probability of the 4...