Question

In: Computer Science

Use the scipy.stats.norm.cdf function to compute the probability that a draw from N(−3, 4) is between...

Use the scipy.stats.norm.cdf function to compute the probability that a draw from N(−3, 4) is between 5 and 7. submit your jupyter notebook for this problem.

Using python.

Solutions

Expert Solution

  • Below is the detailed explanation of the problem mentioned above(in PYTHON) to calculate probability that a draw from N(−3, 4) is between 5 and 7.
  • Probability comes out to be 3.138459026119644e-05 which is approximately 0.00003138459
  • Explanation:

We have normal distribution(also gaussian distribution) N(,2) where is mean and is standard deviation and  2 is variance , which is a continuous probability distribution for arandom variable X(which is real valued).

For calculating probability of a normal distribution we have norm.cdf in scipy.stats.

So we have to calculate P(5<X<7), so to calculate this probability of an interval we will subtract one cdf from another.

Here we have N(,2) as N(-3, 22) so =-3 and =2.

This norm.cdf(x,loc,scale) has location which is mean, scale which is our standard deviation and x is the limit to our random variable i.e,x is in P(X<x).

So for 5<X<7, we have p= ( norm.cdf(x=7, loc=-3, scale=2) -  norm.cdf(x=5, loc=-3, scale=2) )

  • The code is shown below with comments added.
  • CODE:

#import module
from scipy.stats import norm

#calculate the probability of normal distrubution for x<7
cdf1=norm.cdf(x=7, loc=-3, scale=2)
#calculate the probability of normal distrubution for x<5
cdf2=norm.cdf(x=5, loc=-3, scale=2)
#for P(5<x<7)
p=cdf1-cdf2
#print p
print(p)

  • OUTPUT:
    3.138459026119644e-05
  • Below is the sceenshot of the code and output for better clarity and understanding.

CODE and OUTPUT

So if you still have any doubt regarding this solution please feel free to ask it in the comment section below and if it is helpful then please upvote this solution, THANK YOU.


Related Solutions

Let n be a random number between 1 and 100000 chosen with uniform probability. Compute a)...
Let n be a random number between 1 and 100000 chosen with uniform probability. Compute a) The probability that n can be divided by 3 b) The probability that n can be divided by 6 c) The probability that n can be divided by 9 d) The probability that n can be divided by 9 given that in can be divided by 6 e) The probability that n can be divided by 6 given that in can be divided by...
Write a function sum_int( n ) to compute the sum of the integers from 1 up...
Write a function sum_int( n ) to compute the sum of the integers from 1 up to and including n.
Use Huff’s law to compute the probability of consumers traveling from their homes to each of...
Use Huff’s law to compute the probability of consumers traveling from their homes to each of three shopping areas: Square footage of selling space: Location 1 = 15,000 Location 2 = 20,000 Location 3 = 25,000 Travel time: To location 1 = 12 minutes To location 2 = 18 minutes To location 3 = 25 minutes Effect of travel time on shopping trip is 2. For full credit you need to show your full equation AND explain how you used...
Find the probability that x is between five and 11. X ~ N(6, 3)
Find the probability that x is between five and 11. X ~ N(6, 3)
With R coding Obs: it supposed to use probability density function like X ~ Binomial( n...
With R coding Obs: it supposed to use probability density function like X ~ Binomial( n ,p ) dbinom(X=?, n, prob) pbinom(X=?, n, prob) rbinmo(幾個符合二項分配的X, n, prob) X~Poisson (lamda) dpois(X=?, lamda) ppois (X=?, lamda) rpois (X, lamda) Exercises 1) A food company produces canned food, and the weight of each can on the production line is in accordance with normal distribution. N (175, 102) (Unit: gram) (a) Specifications indicate that each can weight lless than 155, what is the possibility...
2) X and Y have the following joint probability density function: n=4, X=2, Y=1, Z=3 Find:...
2) X and Y have the following joint probability density function: n=4, X=2, Y=1, Z=3 Find: a)Marginal distribution of X and Y. b)Mean of X and Y. c)E(XY). d)Covariance of X and Y and comment on it. e)Correlation coefficient between X and Y. And comment. 2) X and Y have the following joint probability density function: {((5y^3)/(96x^2)) 2<x<5, 0<y<4             0      Elsewhere} Find: a) Marginal distribution of X and Y b) Mean of X and Y c) E(XY) d)...
use simpsons rule to find the integral from 0 to 1, n =4 sqrt(1+x^3)
use simpsons rule to find the integral from 0 to 1, n =4 sqrt(1+x^3)
2. Consider an n-cube, where n = 3. Is it possible to draw this on a...
2. Consider an n-cube, where n = 3. Is it possible to draw this on a two dimensional plane where the lines do not cross? If it is possible, draw it. If not, prove that it isn't possible.
Prove that for every n ∈ N: a) (10^n + 3 * 4^(n+2)) ≡ 4 mod...
Prove that for every n ∈ N: a) (10^n + 3 * 4^(n+2)) ≡ 4 mod 19, [note that 4^3 ≡ 1 mod 9] b) 24 | (2*7^(n) + 3*5^(n) - 5), c) 14 | (3^(4n+2) + 5^(2n+1) [Note that 3^(4n+2) + 5^(2n+1) = 9^(2n)*9 + 5^(2n)*5 ≡ (-5)^(2n) * 9 + 5^(2n) *5 ≡ 0 mod 14]
Assume a binomial probability distribution with n= 45 and π= 0.28 . Compute the following: (Round...
Assume a binomial probability distribution with n= 45 and π= 0.28 . Compute the following: (Round all your z values to 2 decimal places.) A. The mean and standard deviation of the random variable. (Round your "σ" to 4 decimal places and mean to 1 decimal place.) B. The probability that X is 17 or more. (Use the rounded values found above. Round your answer to 4 decimal places.) ​​ C. The probability that X is 7 or less. (Use...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT