3 Pages

Solutions05

Course: M 343, Fall 2009
School: Calvin
Rating:
 
 
 
 
 

Word Count: 3872

Document Preview

odd Solutions 2.1 a) case: m is middle value; even case: middle values are m d and m + d for some d, so m is the median. b) Suppose L values are less than m and E values equal to m. Then there are also L values greater than m. Since m d + m + d = 2m, the sum of the values is xi = xi <m xi + xi >m xi + xi =m xi = 2Lm + Em = (2L + E)m, so the mean is m. c) {5, 1, 0, 2, 4} has both mean and median...

Register Now

Unformatted Document Excerpt

Coursehero >> Michigan >> Calvin >> M 343

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
odd Solutions 2.1 a) case: m is middle value; even case: middle values are m d and m + d for some d, so m is the median. b) Suppose L values are less than m and E values equal to m. Then there are also L values greater than m. Since m d + m + d = 2m, the sum of the values is xi = xi <m xi + xi >m xi + xi =m xi = 2Lm + Em = (2L + E)m, so the mean is m. c) {5, 1, 0, 2, 4} has both mean and median equal to 0 but is not symetric. 2.6 SS (c) = 2(xi c) = 2 (( xi ) nc)) = 0 c = 1 n (xi ) = x. 2.7 ve 0s and ve 10s. 2.8 Have all the values be the same. Variance is zero. 2.9 > award <- scan() 1: 37 60 75 115 135 140 149 150 238 17: 1050 1100 1139 1150 1200 1200 1250 28: Read 27 items > sum(award^2) [1] 24657511 > mean(award) + c(-1,1) * 2 * sd(award) [1] -466.4174 1961.1581 290 340 410 600 750 1576 1700 1825 2000 750 750 1015 Index 3.3 Let X be any continuous random variable with range [1, 2]. Let Y be determined as follows: ip a coin. If it is heads, Y = 0. Otherwise Y = X. 3.5 This is equivalent to looking for non-negative integer solutions to x + y + z = 12. By analogy to Example 3.2.5, there are 12 + 1 (122 ) such solutions. 2 3.6 > (choose(13,2)*choose(4,2)*choose(4,2)*choose(11,1)*choose(4,1)) / choose(52,5) [1] 0.04753902 3.7 > (choose(13,1)*choose(4,3)*choose(12,1)*choose(4,2)) / choose(52,5) [1] 0.001440576 3.8 > (choose(13,1)*choose(4,3)*choose(12,2)*choose(4,1)*choose(4,1)) / choose(52,5) [1] 0.02112845 3.9 > > > > > > p<-rep(NA,4) p[1] <- choose(4,1) * choose(13,5) / choose(52,5) p[2] <- choose(4,2) * ( choose(26,5) - (choose(13,5)+choose(13,5))) / choose(52,5) p[4] <- choose(4,1) * choose(13,2) * 13 * 13 * 13 / choose(52,5) p[3] <- 1 - sum(p[-3]) # sum of all probabilities must be 1 rbind(1:4,p) 1.000000000 2.0000000 3.0000000 4.0000000 p 0.001980792 0.1459184 0.5883553 0.2637455 3.10 1016 c 2007 Randall Pruim (rpruim@calvin.edu) Index > birthdayprob <- function(n) { # calculates prob of shared birthday + last <- 366 - n; + 1 - ( prod(seq(last,365)) / 365^n ); + } > > birthdayprob(10); [1] 0.1169482 > cbind(20:25,sapply(20:25,birthdayprob)) [,1] [,2] [1,] 20 0.4114384 [2,] 21 0.4436883 [3,] 22 0.4756953 [4,] 23 0.5072972 [5,] 24 0.5383443 [6,] 25 0.5686997 3.13 P(AB C) = P(A)+P(B)+P(C)P(AB)P(AC)P(B C)+P(AB C) 3.14 P(Bad) = 3/18; P(AL 1) = 8/18 2/18 8/18 ; P(Bad | AL 1) = 2/8 = P(AL 1 | Bad) = 2/3 = 2/18 3/18 3.17 If A and B are independent, then P(A | B c ) = = P(A B c ) P(A) P(A B) = c) P(B 1 P(B) P(A) P(A) P(B) P(A)(1 P(B)) = , 1 P(B) 1 P(B) so A and B c are independent. Part (b) follows from this (or can be proven analogously). 3.18 P(S) = 11 = 0.12088 91 P(A) = 50 91 15:21 -- December 4, 2007 1017 Index 6 = 0.0659 91 11 50 P(A) P(S) = = 0.0664 91 91 P(S and A) = P(S|A) = 6 91 50 91 = 0.12 3.19 P(D) = P(D and AA) + P(D and Aa) + P(D and aa) = P(AA) P(D|AA) + P(Aa) P(D|Aa) + P(aa) P(D|aa) = (.25)(.01) + (.5)(.05) + (.25)(.5) = .1525 P(C+ and T +) P(T +) 3.20 Goal: Compute P(C + |T +) = Data: P(C+) = 2/3 [based on prior information] P(T + |C+) = .7 [sensitivity] Results: P(T |C) = .9 [specicity] P(T + and C+) = P(C+) P(T + |C+) = (2/3)(0.7) = 14/30 P(T + and C) = P(C) P(T + |C) = (1/3)(0.1) = 1/30 So P(C + |T +) = 14/30 15/30 = 14/15 = 0.9333 For part b, compute P(C + |T ) instead. Same methods work. (Answer is 6/15) 3.21 P(All 5 numbers the same) = 1 1 1 1 6 6 6 3.23 Let p = P(D), then P(D | +) = 1 6 Now we can let R do the work. P(D +) P(D) P(+ | D) p .98 = = P(+) P(D +) + P(H +) p .98 + (1 p) .01 1018 c 2007 Randall Pruim (rpruim@calvin.edu) Index > p <- c(.01,.10) > ( p * .98 ) / ( p * .98 + (1-p)*0.01 ); [1] 0.4974619 0.9158879 3.24 > factorial(10) / ( factorial(3) * factorial(3) * factorial(2) ) [1] 50400 3.25 > choose(90,4)/choose(100,4) # prob only good ones selected [1] 0.6516305 > 1 - choose(90,4)/choose(100,4) # lot is rejected [1] 0.3483695 > f <- function(x) { 1 - choose(100-x,4)/choose(100,4) } > myplot <- xyplot(sapply(10:100,f) ~ 10:100, type=l, + xlab="number of defective parts", + ylab="probability of rejecting", + lwd=2, + col="navy"); 1.0 probability of rejecting 0.8 0.6 0.4 20 40 60 80 100 number of defective parts 3.26 15:21 -- December 4, 2007 1019 Index > 1/8 + # HHH-+ 1/16 + # or THHH+ 1/16 # or -THHH [1] 0.25 3.29 The wines can be presented in 24 = 4 3 2 1 dierent orders, so the probability of guessing correctly is 1/24. 3.31 > 8*5*4 / choose(17,3) # 1 sock of each kinds means no pairs [1] 0.2352941 > 1 - (8*5*4 / choose(17,3)) # so this is prob of getting a pair [1] 0.7647059 # or do it this way > ( choose(8,2)*9 + choose(5,2) * 12 + choose(4,2) * 13 + + choose(8,3) + choose(5,3) + choose(4,3) ) / choose(17,3) [1] 0.7647059 3.32 Let F be the event that a double-headed (fake) coin is selected, then a) P(F | H) = P(F and P(H) H) = 1 1 3 1 1 0+ 3 2 + 1 1 3 = 2 3 1 0+ 1 1 + 1 1 3 3 4 3 1 0+ 1 1 + 1 1 3 3 2 3 b) P(H | H) = c) P(F | HH) = P(H and H) P(H) P(F = P(HH) P(H) = = 5 6 and HH) P(HH) = 1 1 3 0+ 1 1 + 1 1 3 4 3 = 4 5 = 0.80 3.33 > 1 - dbinom(0,4,1/6) # P(at least one 6 in 4 tries) [1] 0.5177469 > pgeom(3,1/6) # P(fail at most 3 times before getting a 6) [1] 0.5177469 > 1 - dbinom(0,24,1/36) # P(at least one double 6 in 24 tries) 1020 c 2007 Randall Pruim (rpruim@calvin.edu) Index [1] 0.4914039 > pgeom(23,1/36) [1] 0.4914039 # P(fail at most 23 times before getting double 6) 3.34 3.38 value of X probability 1 .4 2 .3 3 .2 4 .1 > dbinom(10,10,.8) [1] 0.1073742 > 1 - pnbinom(4,10,.80) [1] 0.1298396 > pbinom(9,14,.8) [1] 0.1298396 > > 1 - pnbinom(4,10,.70) [1] 0.4157988 > pbinom(9,14,.7) [1] 0.4157988 # make 10 straight # at least 5 misses = at least 15 shots # 9 or fewer makes in 14 tries -> at least 15 shots # at least 5 misses = at least 15 shots # 9 or fewer makes in 14 tries -> at least 15 shots 3.39 > pp <- dbinom(5,5,.80); pp # a) prob make 5 straight (= success) [1] 0.32768 > dgeom(1,pp) # b) succeed with 1 miss (correct answer) [1] 0.2203058 > 0.20 * pp # miss first then make 5 straight (_not_ the answer) [1] 0.065536 > > 1 - pgeom(1,pp) # c) miss more than one shot before success [1] 0.4520142 > probs <- dgeom(0:15,pp) # d) > myplot <- xyplot(probs~0:15,main="Freddie",xlab="misses",ylab="probability"); ################################################################# > pp <- dbinom(5,5,.70) # a) prob make 5 straight (= success) > pp 15:21 -- December 4, 2007 1021 Index [1] 0.16807 > > dgeom(1,pp) # b) succeed with 1 miss (correct answer) [1] 0.1398225 > 0.20 * pp # miss first then make 5 straight (_not_ the answer) [1] 0.033614 > > 1 - pgeom(1,pp) # c) miss more than one shot before success [1] 0.6921075 > probs <- dgeom(0:15,pp) # d) > myplot <- xyplot(probs~0:15,main="Frank",xlab="misses",ylab="probability") Freddie Frank 0.3 0.15 probability probability 0.2 0.10 0.1 0.05 0.0 0 5 10 15 0 5 10 15 misses misses 3.40 > 1 [1] > 1 [1] > 1 [1] - pbinom(11,20,.25) # 11 or fewer correct fails 0.0009353916 - pbinom(11,20,1/3) # 11 or fewer correct fails 0.01297330 - pbinom(11,20, .5 + .4 * 1/3 + .1 * 1/4) 0.7865717 3.42 a) P(X k) = x=k (1 )x = (1)k 1(1) = (1 )k . P(X=x and Xk) P(Xk) b) Assuming x k, P(X = x | X k) = P(X = x k) = (1)x (1)k = (1 )x k = 1022 c 2007 Randall Pruim (rpruim@calvin.edu) Index 3.43 > binom.test(8,50,.25) Exact binomial test data: 8 and 50 number of successes = 8, number of trials = 50, p-value = 0.1899 alternative hypothesis: true probability of success is not equal to 0.25 95 percent confidence interval: 0.07170077 0.29112631 sample estimates: probability of success 0.16 3.45 > binom.test(428,428+152,.75); Exact binomial test data: 428 and 428 + 152 number of successes = 428, number of trials = 580, p-value = 0.5022 alternative hypothesis: true probability of success is not equal to 0.75 95 percent confidence interval: 0.7001255 0.7732932 sample estimates: probability of success 0.737931 3.46 > binom.test(10,10+17); Exact binomial test 15:21 -- December 4, 2007 1023 Index data: 10 and 10 + 17 number of successes = 10, number of trials = 27, p-value = 0.2478 alternative hypothesis: true probability of success is not equal to 0.5 95 percent confidence interval: 0.1940072 0.5763204 sample estimates: probability of success 0.3703704 > binom.test(36,7+36); Exact binomial test data: 36 and 7 + 36 number of successes = 36, number of trials = 43, p-value = 8.963e-06 alternative hypothesis: true probability of success is not equal to 0.5 95 percent confidence interval: 0.6929891 0.9319479 sample estimates: probability of success 0.8372093 In the rst case, the p-value is large, so there is not enough evidence to reject the null hypothesis (that the wasps have no preference between the two options). It could be the that the dierence in wasp behavior is simply due to random chance. In the second case, the p-value is very small, so we reject the null hypothesis (that wasps have no preference between the two options). 3.47 > qbinom(.975,200,.5) [1] 114 > qbinom(.025,200,.5) [1] 86 > pbinom(85:86,200,.5) [1] 0.02001860 0.02798287 > 1 - pbinom(114:115,200,.5) [1] 0.02001860 0.01406270 1024 c 2007 Randall Pruim (rpruim@calvin.edu) Index > # define a function to calculate power for given sample size. > power = function(size,null=.50,alt=.55){ + leftCritical <- -1 + qbinom(.025, round(size),null) + rightCritical <- 1 + qbinom(.975, round(size),null) + leftPower <- pbinom( leftCritical, round(size),alt); + rightPower <- 1 - pbinom( rightCritical - 1, round(size),alt); + + result <- leftPower + rightPower; + + # the rest of this allows for more verbose output + attr(result,"power") = leftPower + rightPower; + attr(result,"null") = null; + attr(result,"alt") = alt; + attr(result,"leftCritical") = leftCritical; + attr(result,"rightCritical") = rightCritical; + attr(result,"leftPower") = leftPower; + attr(result,"rightPower") = rightPower; + + return (result); + } > # just the power values: > as.numeric(power(200)); [1] 0.2619829 > as.numeric(power(400)); [1] 0.4806564 > # more verbose output: > power(200); [1] 0.2619829 attr(,"power") [1] 0.2619829 attr(,"null") [1] 0.5 attr(,"alt") [1] 0.55 attr(,"leftCritical") [1] 85 15:21 -- December 4, 2007 1025 Index attr(,"rightCritical") [1] 115 attr(,"leftPower") [1] 0.0002581707 attr(,"rightPower") [1] 0.2617247 > > power(400); [1] 0.4806564 attr(,"power") [1] 0.4806564 attr(,"null") [1] 0.5 attr(,"alt") [1] 0.55 attr(,"leftCritical") [1] 179 attr(,"rightCritical") [1] 221 attr(,"leftPower") [1] 2.478852e-05 attr(,"rightPower") [1] 0.4806316 > # find sample size with 90% power > uniroot(function(size){ as.numeric(power(size)) -.90} ,c(400,5000)) $root [1] 1075.5 $f.root [1] -0.001766926 $iter [1] 26 $estim.prec [1] 6.103516e-05 1026 c 2007 Randall Pruim (rpruim@calvin.edu) Index 3.48 With a sample of size 200, the power of a test of the null hypothesis that the coin is fair against an alternative where the coin has a probability of .55 of coming up heads is approximately 26%. With a sample size of 400, the power increases to approximately 48%. To achieve 90% power, we need a sample size of approximately 1075. 3.49 It turns out that some of these tests dont actually have = .05. This is because the binomial distribution is discrete, and for some combinations of n and , we cant approximate = 0.05 as accurately as for others. So some of these tests might have an actual value that is less than 0.05, which makes the test less powerful. 3.50 Many examples exist. t(x) = x2 works for any random variable that is not constant. 3.51 The rst equality is the denition of expected value. 1 2: we omit the rst term from the sum since it is 0. 2 3: factor out n x n x from binomial coecient. Note that = n! n (n 1)! n n1 = = x!(n x)! x (x 1)!(n x)! x x1 . 3 4: change of variable, y = x 1. 4 5: sum is now all the probabilities of a binomial random variable with parameters n 1 and , so the sum is 1. 3.52 (3.5) denition. (3.6) expand the square. (3.7) distribute over sum and split into multiple summations. (3.8) denition of expected value and factoring of constants. 15:21 -- December 4, 2007 1027 Index (3.9) denition of expected value and sum of probabilities must be 1. (3.10) simple algebra and renaming. a2 E(X 2 ) 3.53 Var(aX + b) = E((aX + b)2 ) E(aX + b)2 = E(a2 X 2 + 2abX + b2 ) (a E(X) + b)2 = + 2ab E(X) + b2 a2 E(X)2 2ab E(X) b2 = a2 Var(X). 3.55 > vals <- 0:50; > probs.x <- dnbinom(vals,3,.5); > probs.y <- dnbinom(vals,3,.2); > var.x <- sum(vals^2 * probs.x) - sum(vals [1] 6 > var.y <- sum(vals^2 * probs.y) - sum(vals [1] 58.67976 > # better approximation using more terms: > vals <- 0:500; > probs.x <- dnbinom(vals,3,.5); > probs.y <- dnbinom(vals,3,.2); > var.x <- sum(vals^2 * probs.x) - sum(vals [1] 6 > var.y <- sum(vals^2 * probs.y) - sum(vals [1] 60 * probs.x)^2; var.x; * probs.y)^2; var.y; * probs.x)^2; var.x; * probs.y)^2; var.y; 3.56 E(X) = E(X 2 ) = n 1 1 n+1 k=1 k n = n (1 + 2 + + n) = 2 . n 1 1 n(n+1)(2n+1) 21 2 2 k=1 k n = n (1 + 2 + + n ) = n 6 = (n+1)(2n+1) . 6 3.57 Part (a): This is just a uniform random variable, so the mean is n+1 2 = 128. 1 2 4 8 16 32 64 Part (b): E(X) = 1 255 +2 255 +3 255 +4 255 +5 255 +6 255 +7 255 +8 128 7.03. 255 1028 c 2007 Randall Pruim (rpruim@calvin.edu) Index # expected value of binary search > vals <- 1:8; > probs <- 2^(vals-1) / 255; > sum(vals*probs); [1] 7.031373 > # expected value of linear search > vals <- 1:255; > probs <- rep(1/255,255) > sum(vals*probs); [1] 128 3.63 For every x, y, and z, P(X = x and Y = y | Z = z) = P(X = x | Z = z) P(Y = y | Z = z) So once we know the value of Z, knowing the value of X or Y gives no additional information about the other. 3.65 We have already handled the case where r = 1. If r > 1, then we can express X NBinom(r, ) as X = X1 + X2 + Xr where Xi NBinom(1, ) = Geom(), and the Xi s are independent. We already know that E(Xi ) = 1/ 1, so r E(X) = i=1 E(Xi ) = r( 1 r 1) = r 3.70 > f <- function(prob) { prob + prob * (1-prob)^3/(1-(1-prob)^2) } > g <- function(prob) {f(prob) - .50} > uniroot(g,c(.20,.5))$root when # g=0, f=.5 [1] 0.2929236 3.72 15:21 -- December 4, 2007 1029 Index > d <- c(9,13,14,9); dim(d) = c(2,2); d [,1] [,2] [1,] 9 14 [2,] 13 9 > fisher.test(d) Fishers Exact Test for Count Data data: d p-value = 0.238 alternative hypothesis: true odds ratio is not equal to 1 95 percent confidence interval: 0.1141432 1.7066640 sample estimates: odds ratio 0.4533593 > phyper(9,23,22,22) [1] 0.1490436 3.74 > d <- c(61,103,69,44); dim(d) = c(2,2); d [,1] [,2] [1,] 61 69 [2,] 103 44 > fisher.test(d) Fishers Exact Test for Count Data data: d p-value = 0.0001362 alternative hypothesis: true odds ratio is not equal to 1 95 percent confidence interval: 0.2236475 0.6366559 sample estimates: odds ratio 0.3790412 1030 c 2007 Randall Pruim (rpruim@calvin.edu) Index > phyper(61,61+103,44+69,61+69) [1] 7.214999e-05 3.75 The sum is telescoping and simplies to log10 (10) log10 (1) = 1 0 = 1. 4.4 The cdf of an exponential distribution is F (x) = 1ex , so the p-quantile q satises 1 p = eq p = 1 eq ln(1 p) = q ln(1 p) = q ,. So the median is rst, second, and third quartiles are tively. ln(.75) ln(.5) , , and ln(.25) , respec- 4.5 limx F (x) = 0, limx F (x) = 1, and so F is a legitimate cdf. > qcauchy(.9) [1] 3.077684 d dx F (x) = f (x) = 1 (x2 +1) 0 for all x, 4.6 a) P(X 1) = F (1) = 1/4 b) P(.5 X 1) = F (1) F (.5) = 1/4 1/16 = 3/16 c) P(X > 1.5) = 1 F (1.5) = 1 9/16 = 7/16 d) The median of X: m2 /4 = 1/2 = m = 2 e) The pdf of X: f (x) = x/2 15:21 -- December 4, 2007 1031 Index > f <- function(x) {x/2;} # define pdf > integrate(f,lower=0,upper=2); # check it is a pdf 1 with absolute error < 1.1e-14 > xf <- function(x) x^2/2; > integrate(xf,lower=0,upper=2); # expected value 1.333333 with absolute error < 1.5e-14 > xxf <- function(x) x^3/2; > integrate(xxf,lower=0,upper=2); # E(X^2) 2 with absolute error < 2.2e-14 > # compute the variance using E(X^2) - E(X)^2 > integrate(xxf,lower=0,upper=2)$value + (integrate(xf,lower=0,upper=2)$value)^2 [1] 0.2222222 4.7 This can all be done by hand to give exact values, but here is code to show how to get R to do the numerical calculations. > f <- function(x) {1/x^4}; > k <- 1 / integrate(f,1,Inf)$value; k; [1] 3 > f <- function(x) {k / x^4}; > integrate(f,1,Inf); 1 with absolute error < 1.1e-14 > integrate(f,2,3); 0.08796296 with absolute error < 9.8e-16 > xf <- function(x) { x * f(x) }; > # find the median > g <- function(x) { integrate(f,1,x)$value - .5 } > uniroot(g,c(1,10))$root; [1] 1.259922 > > Ex <- integrate(xf,1,Inf)$value; Ex; # E(X) [1] 1.5 > xxf <- function(x) { x^2 * f(x) }; > Exx <- integrate(xxf,1,Inf)$value; Exx; # E(X^2) [1] 3 1032 c 2007 Randall Pruim (rpruim@calvin.edu) Index > Exx - (Ex)^2 [1] 0.75 > sqrt(Exx - (Ex)^2) [1] 0.8660254 # variance # st dev 4.8 > dpois(0,6/3); [1] 0.1353353 > 1-pexp(20/60,rate=6); [1] 0.1353353 > dpois(2,6/3); [1] 0.2706706 > 1-ppois(6,6); [1] 0.3936972 > dpois(6,6); [1] 0.1606231 > ppois(5,6); [1] 0.4456796 > ppois(30,24) - ppois(19,24); [1] 0.7238911 # 0 customers in 1/3 hour # first customer after 1/3 hour # 2 customers in 1/3 hour # more than 6 in 1 hour # exactly 6 in 1 hour # less than 6 in 1 hour # 20 to 30 customers in 4 hours The Poisson model might not be good because (1) arrivals may not be independent (people come in groups or in response to something), and (2) the rate may not be constant over the time period. 15:21 -- December 4, 2007 1033 Index 4.10 MX (t) = E(etX ) n = x=1 etx n 1 n = 1 n (et )x x=1 1 et (et )n+1 = n (1 et ) et 1 ent = n (1 et ) 4.11 4.12 Here is Mathematica code for this problem. In[4]:= Integrate[E^(t*y)*y, {y, 0, 1}] + Integrate[E^(t*y)*(2 - y), {y, 1, 2}] Out[4]= (1 + e^t (-1 + t))/t^2 + (e^t (-1 + e^t - t))/t^2 In[5]:= Integrate[E^(t*y)*y, {y, 0, 1}] Out[5]= (1 + e^t (-1 + t))/t^2 In[6]:= Integrate[E^(t*y)*(2 - y), {y, 1, 2}] Out[6]= (e^t (-1 + e^t - t))/t^2 In[7]:= Together[ Integrate[E^(t*y)*y, {y, 0, 1}] + Integrate[E^(t*y)*(2 - y), {y, 1, 2}]] 1034 c 2007 Randall Pruim (rpruim@calvin.edu) Index Out[7]= (-1 + e^t)^2/t^2 4.13 MX (t) = e+e . 4.14 Uses integration by parts. 4.19 From Mathematica: In[16]:= D[(1 - alpha*t)^(-k), t] Out[16]= alpha k (1 - alpha t)^(-1 - k) In[17]:= D[D[(1 - alpha*t)^(-k), t], t] t Out[17]= -alpha^2 (-1 - k) k (1 - alpha t)^(-2 - k) So the mean is k and the variance is (k + 1)k2 k 2 2 = k2 . 4.23 a) Binom(10, 1/2). b) Norm(1, 1). c) Exp( = 1/2). d) Gamma( = 3, = 1/2) = Gamma( = 3, = 2). 4.25 > pexp(1+1) - pexp(1-1); [1] 0.8646647 > pexp(1/2 + 1/2,rate=2) - pexp(1/2 - 1/2,rate=2) [1] 0.8646647 > punif(.5+ sqrt(1/12),0,1) - punif(.5 - sqrt(1/12),0,1) 15:21 -- December 4, 2007 1035 Index [1] 0.5773503 > s <- sqrt(8/(6^2*7)) > pbeta(2/6 + s,shape1=2,shape2=4) - pbeta(2/6 - s,shape1=2,shape2=4) [1] 0.652183 Things to notice: Both exponential distributions give the same answer. This is because the exponential distributions are all constant multiples of each other. Compared to 68% for the normal distribution, the beta and uniform distribution are lower (not as much piled in the middle), and the exponential distribution is higher. 4.26 # a = shape; b = scale (acts like 1/lambda from exponential dist) > > a <- 2; b <- 3; > m <- b * gamma(1 + 1/a); m # mean [1] 2.658681 > v <- b^2 * ( gamma(1 + 2/a) - gamma(1+1/a)^2 ); v; # var [1] 1.931417 > qweibull(.5,a,b) # median [1] 2.497664 > pweibull(m,a,b) # less than mean [1] 0.5440619 > pweibull(6,a,b) - pweibull(1.5,a,b) # in a range [1] 0.7604851 > pweibull(m+sqrt(v),a,b) - pweibull(m - sqrt(v) ,a,b) # near mean [1] 0.6743336 > # with roles of parameters reversed > > a <- 3; b <- 2; > m <- b * gamma(1 + 1/a); m # mean [1] 1.785959 > v <- b^2 * ( gamma(1 + 2/a) - gamma(1+1/a)^2 ); v; # var [1] 0.4213315 > qweibull(.5,a,b) # median 1036 c 2007 Randall Pruim (rpruim@calvin.edu) Index [1] 1.769994 > pweibull(m,a,b) [1] 0.5093739 > pweibull(6,a,b) - pweibull(1.5,a,b) [1] 0.655816 > pweibull(m+sqrt(v),a,b) - pweibull(m - sqrt(v) ,a,b) [1] 0.6677128 > # less than mean # in a range # near mean 4.27 > m <- 5/(2+5); m; [1] 0.7142857 > v <- 5 * 2 / ( (5+2)^2 * (5 + 2 + 1) ) > qbeta(.5,5,2); [1] 0.73555 > pbeta(m,5,2); [1] 0.4515550 > pbeta(.4,5,2) - pbeta(.2,5,2) [1] 0.03936 > pbeta(m+sqrt(v), 5, 2) - pbeta(m-sqrt(v), 5, 2) [1] 0.662012 # mean # var # median # less than mean # in a range # near mean 5.1 E(X w ) = E( (wi Xi )) = wi = 1. E(wi Xi ) = wi E(Xi ) = wi = precisely when 5.2 SE = 10/ 16 = 2.5. X Norm(0, SE). P(|X | < 2) = > pnorm(2,sd=2.5) - pnorm(-2,2.5) [1] 0.7881412 5.3 > x <- c(1,2,4,4,9) > mu <- sum(x * .2); mu [1] 4 # population mean 15:21 -- December 4, 2007 1037 Index > v <- sum(x^2 *.2) - mu^2; v # population variance [1] 7.6 > pairsums <- outer(x,x,"+") # compute 25 sums > pairmeans <- pairsums/2; > # sampling distribution with SRS > srs.means <- as.vector(pairmeans[lower.tri(pairmeans)]); srs.means; [1] 1.5 2.5 2.5 5.0 3.0 3.0 5.5 4.0 6.5 6.5 > iid.means <- as.vector(pairmeans); iid.means; [1] 1.0 1.5 2.5 2.5 5.0 1.5 2.0 3.0 3.0 5.5 2.5 3.0 4.0 4.0 6.5 2.5 3.0 4.0 4.0 [20] 6.5 5.0 5.5 6.5 6.5 9.0 > > srs.mean <- sum(srs.means * .1); srs.mean [1] 4 > srs.var <- sum(srs.means^2 * .1) - srs.mean^2; srs.var; [1] 2.85 > v/2 * (5-2) / (5-1) [1] 2.85 > sqrt(v/2 * (5-2) / (5-1)) [1] 1.688194 > > var(srs.means) # INCORRECT variance [1] 3.166667 > # sampling distribution with iid sample > iid.mean <- sum(iid.means * .04); iid.mean; [1] 4 > iid.var <- sum(iid.means^2 * .04) - iid.mean^2; iid.var; [1] 3.8 > v/2 [1] 3.8 > sqrt(v/2) [1] 1.949359 > > var(iid.means) # INCORRECT variance [1] 3.958333 5.4 1038 c 2007 Randall Pruim (rpruim@calvin.edu) Index a) Let T be the event that a subject would answer true to question A. Let A be the even that a subject is asked question A. Then = P(subject answers true) = P(T | A) P(A) + P(T c | Ac ) P(Ac ) = + (1 )(1 ) = + 1 + b) = +1 (21) . = (2 1) + (1 ) . c) Given an iid random sample, X = number of true responsees Binom(n, ) which has mean n and variance n(1). So = X has mean (and hence is unbiased) and n (1) variance n . If we have a simple random sample, then the expected value remains unchanged because X is still a sum of (dependent) Bernoulli random variables. d) A natural estimator of is = unbiased. e) see above. n f ) Var() = Var( +1 ) = (21)2 . We can use the identity in (a) to express this in (21) terms of and (but not ) if we like. (1) +1 (21) . E() = E()+1 (21) = +1 (21) = , so is g) The variance of each estimator has n in the denominator, ...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Calvin - M - 343
MATH 343 Fall 2007 Test 2Name:Instructions. Answer carefully and completely. Be sure that your work gives a clear indication of reasoning. Use notation and terminology correctly. If you get stuck on a problem, or get results that don't seem rig
Calvin - PROJECT - 11
yourself your your your your your your you. you, you you you you youyou you you you you you you you you you you you you you you you yonderyonder yet, yet years would would would world. world, world woodlandswonder-world without without without wit
Bryant - BRYANT - 2
CALICO JournalVolume 24+ Number 3 + 20071 CALICO IA JOURNAL DEVOTED TO RESEARCH AND DISCUSSION ON TECHNOLOGY AND LANGUAGE LEARNINGDevoted to research and discussion on technology and language learningCALICO Journal.Volume 24, Number 3,2
Bryant - BRYANT - 2
APPLIED LANGUAGE LEARNING 2006 VOLUME 16 NUMBER 2Applied Language LearningV O L U M E 16 NUMBER 2Applied Language LearningLidia WoytakEditorVolume 16Number 2Applied Language LearningPB 65-06-02The mission of Professional Bulletin 65
Calvin - FORTRAN - 90
An oval is used to indicate the beginning or end of an algorithm.A parallelogram indicates the input or output of information.A rectangle indicates the assignment of values to variables; the assigned value may be the result of some computation. S
Calvin - FORTRAN - 90
(a) A(1, A(1, A(1, A(1, A(2, A(2, A(2, A(2, A(3, A(3, A(3, A(3,1) 2) 3) 4) 1) 2) 3) 4) 1) 2) 3) 4)A(1, 1) A(2, 1) A(3, 1)A(1, 2) A(2, 2) A(3, 2)A(1, 3) A(2, 3) A(3, 3)A(1, 4) A(2, 4) A(3, 4)(b) A(1, A(2, A(3, A(1, A(2, A(3, A(1, A(2, A(3,
Calvin - FORTRAN - 90
CONSTRUCTION PROJECT Obtain project specifications Perform calculations Display resultsObtain personnel requirementsObtain equipment requirementsObtain materials requirementsCalculate personnel costCalculate equipment costCalculate cost o
Michigan State University - NCERA - 125
Minnesota ReportCompiled by: George Heimpel Dept. of Entomology Univ. of Minnesota St. Paul, MN 55108 tel. (612) 624-3480 FAX: (612) 625-5299 email: heimp001@tc.umn.eduContents: Priniciple Investigators Univ. of Minn. Entomology: Andow Heimpel Rag
Calvin - FORTRAN - 90
Deleting at the front of a linked list:Data List Brown Next Data Jones Next Data Lewis Next Data Smith NextTempPtrData List BrownNextData JonesNextData LewisNextData SmithNextTempPtrData List BrownNextData JonesNextData
Calvin - FORTRAN - 90
Calculate initial-value, limit, and step-sizeCalculate initial-value, limit, and step-sizeSet control-variable equal to the initial-valueSet control-variable equal to the initial-valuefalsecontrol-variable limittruefalsecontrol-varia
Calvin - FORTRAN - 90
MainInitialize Initialization routineProcessTransaction Transactionprocessing routineContructIndex Routine to construct Index listSearch Routine to locate record number using IndexProcessOrder Routine to process order, display reorder and o
Calvin - FORTRAN - 90
A B8.5 9.37A = BA B9.37 9.37A B8.5 9.37B = AA B8.5 8.5Delta Rho Temp357 59 ?Temp = DeltaDelta Rho Temp357 59 357Delta = RhoDelta Rho Temp59 59 357Rho = TempDelta Rho Temp59 357 357Sum 132.5 Sum = Sum + X X 8.
Calvin - FORTRAN - 90
0.1 B 0.2 0 0.1 B0.1 C0.15 D0.2 A0.45 E1 0.1 C 0.35 0 0.2 1 0.15 D 0.2 A 0.45 E0 0.1 B1 0.1 C 0.55 0 0.35 0 0.2 1 1 0.15 D 0.2 A 0.45 E0 0.1 B1 0.1 C 0.15 D 1.0 0 0.55 0 0.35 0 0.2 1 1 1 0.2 A 0.45 E0 0.1 B1 0.1 C 0.15 D 0.2 A 0
Calvin - FORTRAN - 90
Memory.real number1 real number2 real number3 real number50 FailureTime ...
Calvin - FORTRAN - 90
Before assignment:pointer 1pointer 2After Assignmenr pointer1 =&gt; pointer2:pointer 1pointer 2Before assignment:pointer 1 pointer 3pointer 2After Assignmenr pointer1 =&gt; pointer2:pointer 1 pointer 3pointer 2Before assignment:StringP
Calvin - FORTRAN - 90
Factorial(5) n Fact = n * Factorial(n - 1) 5 Factorial(4) Fact = n * Factorial(n - 1) n 4 Inductive Step Inductive StepFactorial(3) n Fact = n * Factorial(n - 1) 3 Factorial(2) n Fact = n * Factorial(n - 1) 2 2 Inductive Step Inductive StepFactor
Calvin - FORTRAN - 90
XCoordinate YCoordinate Number Term? ? ? ?XCoordinate YCoordinate Number Term5.23 5.0 17 ?XCoordinate YCoordinate Number Term5.23 5.0 17 7XCoordinate YCoordinate Number Term10.46 5.0 17 7
Calvin - FORTRAN - 90
y y = f(x)P1(x1,y1)P2(x2,y2)cx3x2x1x
Calvin - FORTRAN - 90
11
Calvin - FORTRAN - 90
Calvin - FORTRAN - 90
ABC
Calvin - FORTRAN - 90
ETIANM
Calvin - FORTRAN - 90
AddressMemoryArray Elementbase addressB B+1 B+2Code(1) Code(2) Code(3)B + 49Code(50)
Calvin - FORTRAN - 11
Calvin - FORTRAN - 90
Stack97Data Next84Data Next55Data Next
Calvin - FORTRAN - 90
Calvin - FORTRAN - 90
Calvin - FORTRAN - 90
BEGINEnter CelsiusCalculate Fahrenheit = (9/5)* Celsius + 32Display FahrenheitEND
Calvin - FORTRAN - 90
PredPtrCurrPtr..TempPtrTempPtr%Next =&gt; CurrPtr PredPtr%Next =&gt; TempPtrPredPtr CurrPtr..TempPtr
Calvin - ABSTRACTS - 2004
Technology 21 A Course on Technology for Non-Technologists Abstract There is a need to prepare non-technologists to assume senior management, political and other leadership roles in a highly technological world. Many non-technical college students h
Calvin - M - 256
Official course description for Math 256.The course begins with a brief treatment of logic and the logical forms of mathematical statements and their proofs. Emphasis is on the use of logic as a reasoning aid rather than on the theory of logical sys
Johns Hopkins - APL - 484
RAILS VIEWSTuesday, April 14, 2009SAMPLE PROJECTTuesday, April 14, 2009RAILS MODELSclass Engineer &lt; ActiveRecord:Base has_many :project_assignments, :dependent =&gt; :destroy has_many :projects , :through =&gt; :project_assignments endclass Proj
Calvin - M - 256
Mathematics 256 September 15 &amp; 16, 20081. Rules of Inference (Rosen, 1.5) The rules of logic that may (should) be used in arguments are listed in Table 1 on page 66. Study the table carefully. Make sure you understand what each rule says and that it
Calvin - M - 256
Mathematics 256 September 18 &amp; 19, 20081. Sets (Rosen, 2.1 &amp; 2.2) Terminology. Set, element, empty set, subset, proper subset, set equality. Be sure you distinguish between and . (For example, 1 Z and {1} Z, but {1} Z.) The distinction between
Calvin - M - 256
Mathematics 256 October 10 &amp; 14, 2008Mathematical Induction (Rosen 4.1) Mathematical induction is a form of proof that is used to prove statements of the following structure: n Z+ P (n), where P (n) is some statement about the positive integer n. A
Calvin - M - 256
Mathematics 256, Final Exam 9:00 a.m.12:00 noon, December 18, 2008The nal exam will be comprehensive. Approximately 40% of the exam will cover discrete mathematics and 60% will cover linear algebra. Your nal exam score may replace one of the two tes
Calvin - M - 231
Mathematics 231 A Test 2, Friday, March 31, 2006Sections from textbook: 3.13.9 and 6.16.2. Topics: 1. Second order linear differential equations. (a) Theory (i) Existence and uniqueness theorem (Theorem 3.2.1) (ii) Principle of Superposition (Theore
Calvin - M - 100
Euclids Algorithm and Solving Congruences Mathematics 100 A September 22, 2006Denition. The greatest common divisor of two natural numbers a and b, written gcd(a, b), is the largest natural number that divides both a and b. Middle School Algorithm.
Calvin - ENGR - 332
Calvin College- Engineering DepartmentEngineering 332 Analog Design Spring 2002Professor: Paulo F. Ribeiro, SB130 X6407, PRIBEIRO@CALVIN.EDU Textbook: Sedra / Smith, Microelectronic Circuits, Fourth Edition Lectures: 12:30-1:20PM (MWF) SB203 Lab
Calvin - CH - 08
36243_1_p1-2912/8/97 8:39 AM Page 23MORE ABOUT FUNCTION PARAMETERSDefault Values for Parameters in FunctionsProblem. We wish to construct a function that will evaluate any real-valued polynomial function of degree 4 or less for a given real val
Calvin - CH - 01
36243_2_p31-3412/8/97 8:42 AMPage 3136243AdamsPRECEAPPENDIX 2 JA ACS11/17/97pg 31CODES OF ETHICSThe PART OF THE PICTURE: Ethics and Computing section in Chapter 1 noted that professional societies have adopted and instituted codes
Calvin - CH - 14
14.4 The STL list&lt;T&gt; Class Template114.4 The STL list&lt;T&gt; Class TemplateIn our description of the C+ Standard Template Library in Section 10.6 of the text, we saw that it provides a variety of other storage containers besides vector&lt;T&gt; and that o
Calvin - CH - 15
15.4 An Introduction to Trees1TREES IN STLThe Standard Template Library does not provide any templates with Tree in their name. However, some of its containers - the set&lt;T&gt;, map&lt;T1, T2&gt; , multiset&lt;T&gt;, and multmap&lt;T1, T2&gt; templates - are generall
Calvin - CH - 10
10.2 C-Style Arrays1VALARRAYSAn important use of arrays is in vector processing and other numeric computation in science and engineering. In mathematics the term vector refers to a sequence (one-dimensional array) of real values on which various
Calvin - CH - 15
15.3 Recursion Revisited1EXAMPLE: DRY BONES!The Old Testament book of Ezekiel is a book of vivid images that chronicle the siege of Jerusalem by the Babylonians and the subsequent forced relocation (known as the exile) of the Israelites followin
Calvin - CH - 10
10.7 An Overview of the Standard Template Library1STL Iterators. The Standard Template Library provides a rich variety of containers:vector list deque stack queue priority_gueue map and multimapset and multiset The elements of a vector&lt;T&gt; can
Calvin - CH - 05
5.5 Case Study: Decoding Phone Numbers15.5 Case Study: Decoding Phone NumbersPROBLEMTo dial a telephone number, we use the telephones keypad to enter a sequence of digits. For a long-distance call, the telephone system must divide this number i
Calvin - CH - 01
1.3 Case Study: Revenue Calculation11.3 Case Study: Revenue CalculationPROBLEMSam Splicer installs coaxial cable for the Metro Cable Company. For each installation, there is a basic service charge of $25.00 and an additional charge of $2.00 for
Calvin - CH - 07
7.7 Case Study: Calculating Depreciation17.7 Case Study: Calculating DepreciationPROBLEMDepreciation is a decrease in the value over time of some asset due to wear and tear, decay, declining price, and so on. For example, suppose that a company
Chapman - LUATCS - 99
FIRST SOUTHERN AFRICAN SUMMER SCHOOL AND WORKSHOP ON LOGIC, UNIVERSAL ALGEBRA, AND THEORETICAL COMPUTER SCIENCE (LUATCS'99) Rand Afrikaans University, Johannesburg, South Africa December
Chapman - LUATCS - 99
T T ) q T T q q) ) T &amp;f r t i 8 w i lkjg s59( &amp;s59t)sf sr Rd&amp;sn5&amp;r ur&amp;vssR9}f mkjdw&amp;f {$ o wst {&amp;yp V5 &amp;s9T21 # zo r} r | i g k
Chapman - LUATCS - 99
mee g te iei e ti r i g z g e ti r r ge | r s gw m t ikei zis k g UjkuU@uu@uuijsfjkuYHQi4uysUYf1juyiuyzn4hUvuuui{muyihe d m z z e ti r z ro o k zi r o k i k m t ikei zi we ti r z ro o Ui4fYUvuuysU1ffjiiQR4lujiliiR{hfhfuus vuuijsU5UfyiQR
Chapman - LUATCS - 99
Chapman - LUATCS - 99
&amp;Dh dz|xzdzI|x} pzdzXp f'#f#plto | m z{ypfbXp #f#plto | m xp}uw IXpb{xypz `#f#plto | | m dzXpb{yp #f#plto | m nb#fplto m } p Xp % {sGdzp|5X u x u{s| xyuu {sdxyud|uDwuDw| pzk%p hsDw xyz zy shz xyxIuupz uutu sdsy x|h} x uhxz|
Chapman - LUATCS - 99
A I A I 9 G U i g G qQ q A q I f l9n d 6 A Ad l w6H1RiwiH#PkPgjeFgouH%{ex@wlewQaxg icDjBRQw6ea&quot;caB#c2PkPgjuB@mx{RlBwQkx&quot;R6R6Hm{2u&quot;@s@HuPhj A A A G qQ G f j 8 G qQ n l 9 G U i g G qQ 9 ln d 6 A Ad l g 8 A 6 A I d j d G f l oQ } l n l Q Gd C 6 j G
Chapman - LUATCS - 99
1g%wmogaAAsax%a%9isxa8aBtxsegavg1 ~m6txvi#PB8xsegYP8x 36V 1iw i e f r e f e y w e vegvyu rgva1t1qe ma1te egts{vf rp u u wy w { e f e { { uz f u q e { u f r yvyxeix3vegt'gYt{x}tw{'v
Chapman - LUATCS - 99
p x sG5GGG$5wUU x z ~ q r v r z | | x U r x q z x ~ ~ t | r z ~ t | v { z x v t r q p f$Uf GuUSUbGUGx s| uUUBGyUf5ffG7UUf uff| w}BfGywus$o m n l Q k i jw@ hUB A u g fe Hd ! G f i
Chapman - LUATCS - 99
r g n g p e o g g p e m e v e j m v u n t r h m q p o n t g X1}d s 1Ekdd#id1 1Bksdukb0(0kg 8 k ~ 4X|B`szy Xzx ~gx 6 6 76{81usq8d$kG}kzd~uqu`{1# D4s|7QfdGsG 2 wv18~@ 7ud~5uz #tpy su$ x DkG sE}iiuk ~ A ~ | | z 1
Chapman - LUATCS - 99
|g s u n g w se ue ues opp 5Slgs&amp;Sa(SSltl&amp;2f5Sfa2xrfas ga2rqnrp~rS5la52oaf2S5l%tai6l25SrSi)5Sulyls5f5Su jep o h o g e d u e n e sx e hpe w |g o s n s ue e s opp up w oge w u op p w sx n s n u u n w s d sg u n g e d
Chapman - LUATCS - 99
1From Paraconsistent Logic to Universal LogicJean-Yves Bziau&quot;The undetermined is the structure of everything&quot; AnaximanderAbstract During these last years I have been developed a general theory of logics that I have called Universal Logic. In t
Chapman - LUATCS - 99
\documentclass[10pt]{article}\usepackage{latexsym}\usepackage{amssymb}\usepackage{amsmath}\usepackage{avier}\usepackage{url}\usepackage{nopageno}\addtolength{\voffset}{-1.25cm}\addtolength{\textheight}{2.5cm}\addtolength{\hoffset}{-0.5cm}