Lab 5

.pdf

School

Drexel University *

*We aren’t endorsed by this school

Course

410

Subject

Computer Science

Date

Jan 9, 2024

Type

pdf

Pages

3

Uploaded by MegaOysterMaster676

10/25/23, 5 : 20 PM Lab 5 Page 1 of 3 file:///Users/mathabib/Documents/MATLAB/Lab5.html Lab 5 Mathew H 2023-10-25 library (magrittr) library (formattable) library (LearningStats) library (knitr) Exercise 1: Rate: 3/min, Mean= 15/5min X= 6 or more sum(dpois(6:10000,15)) ## [1] 0.9972076 #or poispeople=1-sum(dpois(0:5,15)) poispeople ## [1] 0.9972076 Example 2: 9% have diabetes if they gave diabetes, test can identify it 85% of time 11% of time, false positive A= having diabetes B= testing positive P(A|B) = ? P(A)= 0.09 P(A’)= 0.91 P(B|A)= 0.85 P(B|A’) = 0.11 prob_double_positive=(0.85*0.09)/(0.85*0.09+0.11*0.91) prob_double_positive ## [1] 0.4331823 Exercise 2: P(typo)=0.002 A:
10/25/23, 5 : 20 PM Lab 5 Page 2 of 3 file:///Users/mathabib/Documents/MATLAB/Lab5.html binomtypo=dbinom(0:10,850,0.002) binomtypo ## [1] 1.823728e-01 3.106551e-01 2.642747e-01 1.497027e-01 6.352615e-02 ## [6] 2.154033e-02 6.079352e-03 1.468930e-03 3.101974e-04 5.815770e-05 ## [11] 9.801728e-06 B: poistypo=dpois(0:10,850*.002) poistypo ## [1] 1.826835e-01 3.105620e-01 2.639777e-01 1.495874e-01 6.357463e-02 ## [6] 2.161537e-02 6.124356e-03 1.487344e-03 3.160605e-04 5.970032e-05 ## [11] 1.014905e-05 Table: comparison=rbind(binomtypo,poistypo) barplot(comparison,names.arg=0:10,beside=T,main="probabilities of typo",legend=T,xlab ="number of typos",ylab="probability")
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