midterm sheet

docx

School

University of New South Wales *

*We aren’t endorsed by this school

Course

2089

Subject

Statistics

Date

Apr 3, 2024

Type

docx

Pages

11

Uploaded by ElderMule3831

Report
Suppose that the number of faulty products per day returned to the manufacturer, X, has the following probability mass function: I T value | 0 [ 1 | 2 I 3 [ probability [0.5 [0.3 [0.1 [0.1 a) Find the expected number of faulty products returned, per day. 0.8 @ | (Enter the exact value in the form of fractions a/b or decimals.) b) The daily cost of managing faulty products, in dollars, is Y = 130 + 8X 1/2 4 2X. Find the expected daily cost. 136.52 @ | (Enter the answer correct to at least 2 decimal places) It is recommended that each month you don't eat any more than 600 grams of prawns caught in Sydney Harbour (due to dioxin contamination). Assume prawn mass has a mean of 12.3 grams and a standard deviation of 5 grams. a) If you catch 52 prawns in Sydney Harbour, what is the chance that eating all of them would exceed the maximum recommended intake? 0.864 @ | (Enter your answer correct to at least 3 decimal places) b) If you eat all 52 prawns anyway, what is an upper limit on the total mass eaten, such that this upper limit would only be exceeded 2% of the time? Give your answer in grams. 714 @ | grams (Enter your answer correct to the nearest integer) ¢) What assumptions did you need to make to answer this question? Tick all that apply. @ The prawns you catch and eat can be treated as a random sample, with their masses being independent and coming from the same distribution Mass of prawns is approximately normally distributed (/] None from scipy.stats import norm mean_mass = 12.3 std_dev = 5 max_intake num_prawns 600 52 total_mean = mean_mass * num_prawns total_std_dev = std_dev * (num_prawns xx 0.5) # Standard deviation of the sum of independent random variables z_score = (max_intake - total_mean) / total_std_dev probability_exceed = 1 - norm.cdf(z_score) print("a) Probability of exceeding maximum recommended intake:", round(probability_exceed, 3)) a) Probability of exceeding maximum recommended intake: 0.864 desired_probability 0.98 z_score_upper_limit = norm.ppf(desired_probability) upper_limit_mass = total_mean + z_score_upper_limit * total_std_dev print("b) Upper limit on total mass eaten:", round(upper_limit_mass, @), "grams") b) Upper limit on total mass eaten: 714.0 grams Seell reasvliavie i uns vase 1 No, because np > 5 d and/or have outliers > data are skew Yes, because n is large (>30) © Yes, because uju’l p)>o unction ' with 99% ty assumption
Paper is being manufactured continuously before being cut and wound into large rolls. The process is monitored for thickness (using a calliper). A sample of 12 measurements on paper, in micrometres, yielded: 12.58, 11.99, 10.66; 13.49, 13.81, 12.35, 12.65; 12.18;, 13.17, 12.91, 12.01, 11.81 Use Matlab or Python to answer the following questions. a) Find the average thickness. 12.39 @ | (Enter your answer correct to at least 2 decimal places) b) Find the standard deviation of thickness. 0.84 @ | (Enter your answer correct to at least 2 decimal places) c¢) Construct a 95% confidence interval for the true mean thickness. [ 11.86 o 12.93 o ] (Enter your answer correct to at least 2 decimal places) d) What assumptions did you make to construct this confidence interval? Select all that apply. No assumptions are required @ Thickness is normally distributed Sa e size is large enough @ We have a random sample measurements = [12.58, 11.99, 10.66, 13.49, 13.81, 12.35, 12.65, 12.18, 13.17, 12.01, 12.01, 11.81] average_thickness = sum(measurements) / len(measurements) print("a) Average thickness:", round(average_thickness, 2)) a) Average thickness: 12.39 import statistics std_dev_thickness = statistics.stdev(measurements) print("b) Standard deviation of thickness:", round(std_dev_thickness, 2)) b) Standard deviation of thickness: 0.84 from scipy.stats import t confidence_level = 0.95 degrees_of_freedom = len(measurements) - 1 t_critical = t.ppf(1 - (1 - confidence_level) / 2, degrees_of_freedom) margin_of_error = t_critical * (std_dev_thickness / (len(measurements) sk 0.5)) confidence_interval = (average_thickness - margin_of_error, average_thickness + margin_of_error) print("c) 95% confidence interval for the true mean thickness:", f" [{round(confidence_intervall@], 2)}, {round(confidence_intervall1l], 2)}1") c) 95% confidence interval for the true mean thickness: [11.86, 12.93]
For the questions below, you will need to use Maple syntax for expressions involving 4 and o : for 4 write mu and for o write sigma 2 for %u write 3/2*mu and for %a write 2/5*sigma*2 Consider a random sample Xl ,X9, ..., Xn with mean p and standard deviation ¢, and the estimator of x defined as L1 = 3 x;. i=1 a) Find the mean of /i b) Find the variance of ji Var(i) = | sigma~2/n c) Is this estimator of y biased? Yes, it is biased. © No, itis unbiased d) Is this estimator of p consistent? is consistent o Yes No, it is not consistent
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
For the questions below, you will need to use Maple syntax for expressions involving 1 and o : for 4 write mu and for o write sigma 2 for %,u write 3/2*mu and for %a write 2/5*sigma*2 Consider a random sample X7, X9, ..., Xpn, with mean x and standard deviation ¢, and the estimator of 4 defined as the average of just the first two observations: a) Find the mean of fi E() = | mu b) Find the variance of /1 Var(i) = | sigman2/2 c) Is this estimator of 14 biased? Yes, it is biased © No, itis unbiased d) Is this estimator of 2 consistent? Yes, it is consistent. © No, itis not consistent = %(Xl +X3)
A power grid has 90 solar collectors as part of its energy production. On a given day, a solar collector has a 9% chance of failing. If a collector fails it is removed from the grid for the rest of the day. a) Use Matlab or Python to find the chance that there are at least 86 solar collectors working by the end of a given day. 0.084 @ | (Enter your answer correct to at least 3 decimal places) b) The amount of daily power that the solar collectors generate, Y~ (in kWh), depends on the number of working solar collectors each day, X, in the following way: Y = 45X 0.4X2 Find the expected power output that the solar collectors will generate on a given day to the nearest kWh. 1000 @ | (Enter your answer correct to the nearest integer) b) E(x) = 100 x 0.92 = 92 Var(X) = 100 x 0.92 x 0.08 = 7.36 Now, Var(X) = E(X?) E(X)? E(X?) = 7.36 + 92° = 8,471.36 Now, E(Y) = 40 x E(X) 0.4 x E(X)? =40 x 92 — 0.4 x 8,471.36 = 291.456 = 292 from scipy.stats import binom total_collectors = 90 success_prob = 0.91 successes_needed = 86 # Probability of at least 86 collectors working probability_at_least_86 = 1 - binom.cdf(successes_needed - 1, total_collectors, success_prob) print("a) Probability of at least 86 solar collectors working by the end of the day:", round(probability_at_least_86, 3)) a) Probability of at least 86 solar collectors working by the end of the day: 0.084
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
a) Given Z ~ N(0, 1), use Matlab or Python to calculate a value z* such that P(—z* < Z < z*) = 0.99 z*¥= | 2576 @ | (Enter your answer correct to at least 3 decimal places) b) In a random sample of 189 certain detonators used with explosives in a coal mining, it was found that 121 of them function properly. i) What is the observed sample proportion of detonators that function properly? 0.64 © | (Enter your answer as a fraction or correct to at least 2 decimal places) ii) What is the size of the smallest sample required to estimate the true proportion of the detonators that function properly to within a maximum error of 0.02, with 99% confidence? (use p obtained in part i) as an estimate of the corresponding true proportion). 3822 @ | (Enter your answer as an integer) iii) To answer part ii) we needed to assume that the sample proportion was approximately normal. Does the normality assumption seem reasonable in this case? Yes, because 7 is large (>30) No, because np > 5 No, because data are skewed and/or have outliers © Yes, because np(1 —p) > 5 Step 3 ii) The required smallest sample size is given by, Z* 2 n= <§> p(1-p) _ (196N (35\ () 35 - <0.02 94 T 04 = 2244.4839 ~ 2245 Explanation: E is the margin of error given as 0.02
The lifetime in hours of a certain kind of radio tube is a random variable having a probability density function given by 0 2<180 fl@) =9 180 . 180 22 a) Find the probability that such a radio tube will have to be replaced within the first 230 hours of operation. 0.217 @ | (Enter your answer correct to at least 3 decimal places) b) A new kind of radio tube has probability 0.1522 that it needs to be replaced within the first 230 hours of operation. Suppose we have 11 of these new kind of radio tubes, all put in usage at the same time and working independently of each other. Use Matlab or Python to find the probability that at most 3 of them will have to be replaced within the first 230 hours of operation. 0.927 @ | (Enter your answer correct to at least 3 decimal places) from scipy.integrate import quad # Define the probability density function (PDF) def f(x): if x <= 180: return 0 else: return 180 / x*x*2 # Integrate the PDF from @ to 230 probability_a, _ = quad(f, 0, 230) print("a) Probability:", round(probability_a, 3)) a) Probability: 0.217 from scipy.stats import binom 11 0.1522 n p probability_b = sum(binom.pmf(k, n, p) for k in range(4)) print("b) Probability:", round(probability_b, 3)) b) Probability: 0.927
A manufacturer produces bolts with a weight of 15 g and a standard deviation of 0.05 g. We check if a batch of bolts falls within specifications by seeing if the average weight of the batch is between 14.99 and 15.01 g. a) If we average the weight of a batch of 80 bolts, what proportion will not meet specifications? 0.074 @ | (Enter your answer correct to at least 3 decimal places) b) How many bolts should be averaged in order for only 8% of batches to be outside specifications? 307 @ | (Enter your answer correct to the nearest integer) c) What assumptions did you need to make to answer this question? Tick all that apply. Bolt weights are approximately normally distributed @ Bolts in a batch can be treated as a random sample, with weight of all bolts being independent and coming from the same distribution (/] None from scipy.stats import norm mean_weight = 15 std_dev = 0.05 lower_limit = 14.99 upper_limit = 15.01 sample_size = 80 # Calculate standard error of the mean SEM = std_dev / (sample_size ** 0.5) # Calculate z-scores for lower and upper limits z_lower = (lower_limit - mean_weight) / SEM z_upper = (upper_limit - mean_weight) / SEM # Find proportion of batches outside specifications proportion_outside_spec = norm.cdf(z_lower) + (1 - norm.cdf(z_upper)) print("a) Proportion of batches not meeting specifications:", round(proportion_outside_spec, 3)) a) Proportion of batches not meeting specifications: 0.074
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
The amount of time that a mobile phone will work without having to be recharged is a random variable having the Exponential distribution with mean 3.3 days. a) Find the probability that such a mobile phone will have to be recharged in less than 1.5 days. 0.365 © | (Enter your answer correct to at least 3 decimal places) b) Suppose a new model of phone has probability 0.2922 of needing to be recharged in less than 1.5 days. We have 19 of these new phones, all put in usage on the same day and working independently of each other. Use Matlab or Python to find the probability that at least 7 of them will have to be recharged in less than 1.5 days. 0.307 ®© | (Enter your answer correct to at least 3 decimal places) from scipy.stats import expon, binom # Parameters mean = 3.3 prob_less_than_1_5 = 0.2922 num_phones = 19 num_successes = 7 # Exponential distribution lambda_param = 1 / mean prob_recharge_less_than_1_5 = expon.cdf(1.5, scale=1/lambda_param) # Binomial distribution prob_less_than_7 = binom.cdf(num_successes - 1, num_phones, prob_less_than_1_5) prob_at_least_7 = 1 - prob_less_than_7 print("a) Probability of recharge in less than 1.5 days:", round(prob_recharge_less_than_1_5, 3)) print("b) Probability of at least 7 out of 19 phones recharge in less than 1.5 days:", round(prob_at_least_7, 3)) a) Probability of recharge in less than 1.5 days: 0.365 b) Probability of at least 7 out of 19 phones recharge in less than 1.5 days: 0.307 Consider a random sample X1, X9, ..., Xp, with mean p and standard deviation o, and the estimator of p defined as the weighted average of just the first two observations: A= %(Xl +6X3) a) Find the mean of /i E(@) = | mu omn b) Find the variance of /i Var(i) = | 37*sigman2/49 oR [’ c) Is this estimator of 1 biased? biased 3 b) Variance of \mu”: 00t o uiased Va’r(u) = Var (l(Xl + 6X2)) =( )2Var (X1) + ( ) Var(X2) d) Is this estimator of y consistent? Free— = (7)o + (8)"? =(n+7)e - ()