BIA 580-A Python-Mid Exam

pdf

School

Stevens Institute Of Technology *

*We aren’t endorsed by this school

Course

580

Subject

Computer Science

Date

Apr 3, 2024

Type

pdf

Pages

2

Uploaded by ConstableKangarooMaster5469

Report
BIA580 – Foundation of Business Analytics Python Mid-Term Deadline: 29 th Nov, 11:59 PM Q1: A biased coin has a probability of 0.6 of landing heads. If the coin is flipped 10 times. 1. Write a Python function to calculate the probability of getting exactly 7 heads. Use the binomial distribution formula to implement your solution. 2. Plot this on a graph for visual representation and explain how you would interpret the graph. Also, calculate the mean and the variance. Q2: A call center receives an average of 10 calls per hour. Assume that the number of calls follows a Poisson distribution. 1. Write a Python function to calculate the probability of receiving exactly 8 calls in each hour using the Poisson probability mass function. 2. Determine the number of calls such that there is a 25% probability of receiving more than that number in a given hour. Express the answer in terms of the Poisson distribution parameter. 3. Plot this in a graph and explain the interpretation. Q3: A deck of cards contains 52 cards, including 4 queens. Suppose you draw 10 cards without replacement. 1. Write a Python function to calculate the probability of drawing exactly 3 queens in the 10 draws using the hypergeometric probability mass function. 2. Determine the number of queens such that there is a 15% probability of drawing fewer queens in the 10 draws. Express the answer in terms of the hypergeometric distribution parameters. 3. Plot this in a graph and explain the interpretation. Q4: Suppose you are playing a game where you toss a fair coin repeatedly until it comes up heads. The probability of getting heads on any single toss is p=0.4. 1. Write a Python function to calculate the probability of needing exactly 5 tosses to get the first heads, using the geometric probability mass function. 2. Determine the number of tosses such that there is a 20% probability of needing more tosses to get the first heads. Express the answer in terms of the geometric distribution parameter. 3. Plot this in a graph and explain the interpretation. Q5: Suppose the heights of a population of adults follow a normal distribution with a mean (μ) of 170 cm and a standard deviation (σ) of 8 cm. 1. Write a Python function to calculate the probability that a randomly selected individual from this population has a height between 160 cm and 180 cm. 2. Now, consider a scenario where you have a sample of 50 individuals randomly selected from this population. Write a Python script to simulate the sample mean height and standard deviation. Provide the mean and standard deviation of the sample data, and then calculate the probability that the average height of this
sample is greater than 172 cm. Compare this simulated probability with the theoretical probability obtained using the properties of the sampling distribution of the sample mean. 3. Plot this in a graph and explain the interpretation. Note: You may use the scipy.stats.norm module for the normal distribution in your script. You can also use the Central Limit Theorem to compute the properties of the sampling distribution. Adjust the parameters and the sample size as needed for your question. Note: You may use the numpy library for random number generation and the scipy.stats.geom module for the geometric distribution in your script. Adjust the parameters and the number of plays as needed for your question. Q6: A factory produces light bulbs, and the probability of a bulb being defective is 0.05. If a sample of 20 bulbs is randomly selected: 1. Write a Python function to calculate the probability of having exactly 2 defective bulbs in the sample using the binomial probability mass function. 2. Calculate the probability of having more than 3 defective bulbs in the sample. Explain how you would use the cumulative distribution function (CDF) of the binomial distribution to find this probability. 3. Plot this in a graph and explain the interpretation.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help