#K72047. Dice Roll Probability Distribution
Dice Roll Probability Distribution
Dice Roll Probability Distribution
You are given an integer n representing the number of fair six-sided dice to roll. Your task is to compute the probability distribution of the sum of the dice outcomes.
For a given number of dice n, the possible sums range from n (when every die shows 1) to 6n (when every die shows 6). The probability for each sum \(S\) is given by:
\[ P(S) = \frac{\text{Number of ways to obtain } S}{6^n} \]
Output the distribution in ascending order of sums. Each line of the output should contain the sum followed by its probability rounded to four decimal places.
inputFormat
The input consists of a single integer n (\(1 \le n \le 10\)), representing the number of dice to roll.
Input is provided via standard input.
outputFormat
For each possible sum from n to 6n, output a line with the sum and the corresponding probability (rounded to 4 decimal places), separated by a space. The output should be sent to standard output.
## sample1
1 0.1667
2 0.1667
3 0.1667
4 0.1667
5 0.1667
6 0.1667
</p>