Soluție HackerRank pentru Binomial Distribution #3, subdomeniul Probability, în Python 3. Include cerința formatată, exemple, explicația pașilor și cod…
- Problemă: Binomial Distribution #3
- Domeniu: Probability
- Limbaj: Python 3
Challenge: Binomial Distribution #3
Subdomeniu: Probability (probability)
Scor cont: 5.0 / 5
Submission status: Accepted
Submission score: 1.0
Submission ID: 464733300
Limbaj: python3
Link challenge: https://www.hackerrank.com/challenges/binomial-distribution-3/problem
Cerință
A manufacturer of metal pistons finds that on average, 12% of his pistons are rejected because they are either oversized or undersized. What is the probability that a batch of 10 pistons will contain
(a) no more than 2 rejects?
(b) at least 2 rejects?
Submission Modes and Output Format
You may submit either an R or Python program to accomplish the above task, or solve the problem on pen-and-paper. Your output should be two floating point/decimal numbers separated by a line, correct to 3 places of decimal.
1. In the text box below, enter two floating point/decimal numbers, correct to 3 places of decimal.
2. Alternatively, you may submit an R program, which uses the above parameters (hard-coded) and computes the answer.
Your answer should resemble something like:
<pre>
0.123
0.456
</pre>
(This is NOT the answer, just a demonstration of what the answering format should resemble).
Cod sursă
print('0.891\n0.342')
