Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Solving Task Using Gaussian Distribution | Commonly Used Continuous Distributions
Probability Theory Basics

book
Challenge: Solving Task Using Gaussian Distribution

Taak

Swipe to start coding

Suppose you are going fishing.
One type of fish is well caught at atmospheric pressure from 740 to 760 mm Hg.
Fish of the second species is well caught at a pressure of 750 to 770 mm Hg.

Calculate the probability that the fishing will be successful if the atmospheric pressure is Gaussian distributed with a mean of 760 mm and a mean deviation of 15 mm.

You have to:

  1. Calculate the probability that pressure is in the [740, 760] range.
  2. Calculate the probability that pressure is in the [750, 770] range.
  3. As our events intersect, we must use the inclusive-exclusive principle. Calculate the probability that pressure falls into the intersection of corresponding intervals.

Oplossing

from scipy.stats import norm

mean = 760
std_dev = 15

# Calculate the probability of pressure between 740 and 760
prob_range_1 = norm.cdf(760, mean, std_dev) - norm.cdf(740, mean, std_dev)

# Calculate the probability of pressure between 750 and 770
prob_range_2 = norm.cdf(770, mean, std_dev) - norm.cdf(750, mean, std_dev)

# Calculate the probability of pressure in both ranges
prob_intersection = norm.cdf(760, mean, std_dev) - norm.cdf(750, mean, std_dev)

# Calculate the combined probability using the inclusion-exclusion principle
combined_prob = prob_range_1 + prob_range_2 - prob_intersection

print(f'Probability is {combined_prob:.4f}')

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 4. Hoofdstuk 5
from scipy.stats import norm

# Parameters of the distribution
mean = 760
std_dev = 15

# Calculate the probability of pressure between 740 and 760
prob_range_1 = norm.___(___, mean, std_dev) - norm.___(___, mean, std_dev)

# Calculate the probability of pressure between 750 and 770
prob_range_2 = norm.___(___, mean, std_dev) - norm.___(___, mean, std_dev)

# Calculate the probability of pressure in both ranges
prob_intersection = norm.cdf(___, mean, std_dev) - norm.cdf(___, mean, std_dev)

# Calculate the combined probability using the inclusion-exclusion principle
combined_prob = prob_range_1 + prob_range_2 - prob_intersection

print(f'Probability is {combined_prob:.4f}')

Vraag AI

expand
ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt