Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to analyze the points of n dice in big data

Shulou Source: shulou.com Published: 2022-06-01 15:40:17 10月03日 Update

Big data in how to analyze n dice points, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Throw n dice on the ground and the sum of the points on one side of all the dice is s. Enter n to print out the probability of occurrence of all possible values of s.

You need to return the answer with a floating-point array, where the I element represents the probability of the smaller I of the set of points that the n dice can throw.

Example 1:

Enter: 1

Output: [0.16667, 0.16667]

Example 2:

Enter: 2

Output: [0.02778, 0.05556, 0.08333, 0.11111, 0.13889, 0.16667, 0.13889, 0.11111, 0.08333, 0.05556, 0.02778]

Restrictions:

one

Tags: Points dice state input data code ideas equations probability examples range help output clarity number sum representation elements content initial conditions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia vpn Apple Shulou Technology Shulou Information