Culture

Probability And Statistics 6 Hackerrank Solution 🆕 Free Forever

By Eleanor Kittle
probability and statistics 6 hackerrank solution

Photo: Courtesy of Netflix

Probability And Statistics 6 Hackerrank Solution 🆕 Free Forever

mean, std = 20, 2 x1, x2 = 19.5, 22

[ \Phi(x) = \frac12 \left(1 + \texterf\left(\fracx\sqrt2\right)\right) ]

z2 = (185 - 175) / 10 = 10 / 10 = 1

HackerRank expects exactly 4 decimal places. Use ":.4f".format(prob) .

# For sample mean mu_mean = mu sigma_mean = sigma / math.sqrt(n) probability = cumulative_normal(X_bar, mu_mean, sigma_mean) probability and statistics 6 hackerrank solution

You have a large population with a certain mean ( μ ) and standard deviation ( σ ). You draw a random sample of size n . What is the probability that the sample's sum (or mean) lies below, above, or between certain values?

The problem statement for "Probability and Statistics 6" on Hackerrank is as follows: mean, std = 20, 2 x1, x2 = 19

You can find more detailed walkthroughs and similar challenges in the HackerRank 10 Days of Statistics tutorial series. GitHubhttps://github.com basic-probability-puzzles-6.py - GitHub

print(probability)

To solve this, you must consider the two possible outcomes of the first draw from Bag X, as they change the composition of Bag Y. 1. Case A: The ball moved from X to Y is White :

def main(): # Input values (these would be read from stdin in HackerRank) # Example: Max load capacity / target sum X = float(input().strip()) # Target sum (e.g., 4950) n = float(input().strip()) # Sample size (e.g., 100) mu = float(input().strip()) # Population mean (e.g., 50) sigma = float(input().strip()) # Population std dev (e.g., 2) You draw a random sample of size n