Publications by Andrew Bowen

DATA 605 Problem Set 10

02.04.2023

Problem Smith is in jail and has 1 dollar; he can get out on bail if he has 8 dollars. A guard agrees to make a series of bets with him. If Smith bets \(A\) dollars, he wins A dollars with probability \(0.4\) and loses \(A\) dollars with probability \(0.6\). Find the probability that he wins 8 dollars before losing all of his money if: a. He bets 1...

2126 sym R (977 sym/9 pcs)

DATA605 Discussion Post Week 10

30.03.2023

Exercise 11.1.13 Write a program to compute \(u^{(n)}\) given \(\textbf{u}\) and \(P\). Use this program to compute \(u^{(10)}\) for the Land of Oz example, with \(u = (0,1,0)\), and with \(u = (1/3, 1/3, 1/3)\). First, let’s define our transition probability matrix \(P\) for each weather type (Rainy, Sunny, Nice) # First, define our P matrix n <...

866 sym

Andrew Bowen DATA605 Discussion Post Week 7

22.03.2023

library(glue) library(ggplot2) Exercise 9.3.9 How large must n be before \(S_n = X_1 +X_2 + \dots + X_n\) is approximately normal? This number is often surprisingly small. Let us explore this question with a computer simulation. Choose n numbers from \([0, 1]\) with probability density \(f(x)\), where \(n = 3, 6, 12, 20\), and \(f(x)\) is each of ...

1715 sym R (3922 sym/25 pcs) 23 img

DATA605: Problem Set 9

22.03.2023

Exercise First, let’s define our distribution parameters for \(X_n = Y_{n + 1} - Y_{n}\). We can do some manipulation and substitution to get to a random variable definition we can use: \[\begin{aligned} X_n = Y_{n + 1} - Y_{n} Y_{n+1} = X_n + Y_n \end{aligned}\] mu <- 0 sigma = sqrt(1 / 4) sn <- sqrt(365) \(Y_{365} \ge 100\) (pnorm(q = (10...

4886 sym

DATA605: Problem Set 8

19.03.2023

Exercise 7.2.11 (p. 303) From exercise 10, we are given that the density for a random variable \(M\) which is the minimum of a set of random variables \(X_1, X_2, \dots, X_n\) following an exponential distribution is \(\mu/n\), \(\mu\) is the mean of the random \(X_j\) In the case of our company, we can take 1000 hours to be the mean value for the...

4769 sym R (841 sym/12 pcs)

DATA 605: Discussion Post Week 8

15.03.2023

Probability Exercise 7.1.3 Question: Let \(X_1\) and \(X_2\) be independent random variables with common distribution \[\begin{aligned} p_X = \begin{pmatrix} 0 & 1 & 2 \\ \frac{1}{8} & \frac{3}{8} & \frac{1}{2} \end{pmatrix} \end{aligned}\] Find the distribution of the sum \(Z = X_1 + X_2\) Solution We can build off t...

2558 sym

DATA605: Discussion Post Week 7

07.03.2023

library(dplyr) DATA605: Discussion Post Week 7 Exercise 3.2.6: A die is rolled twice. Let X denote the sum of the two numbers that turn up, and Y the difference of the numbers (specifically, the number on the first roll minus the number on the second). Show that E(XY ) = E(X)E(Y ). Are X and Y independent? Let’s define some global variables: ome...

1846 sym R (1837 sym/10 pcs)

DATA605 Assignment 5

27.02.2023

(Bayesian). A new test for multinucleoside-resistant (MNR) human immunodeficiency virus type 1 (HIV-1) variants was recently developed. The test maintains 96% sensitivity, meaning that, for those with the disease, it will correctly report “positive” for 96% of them. The test is also 98% specific, meaning that, for those without the disease, 98%...

7473 sym Python (941 sym/13 pcs)

Andrew Bowen DATA605 Discussion Post 5

22.02.2023

23. Write a program that picks a random number between 0 and 1 and computes the negative of its logarithm. Repeat this process a large number of times and plot a bar graph to give the number of times that the outcome falls in each interval of length 0.1 in [0, 10]. On this bar graph plot a graph of the density \(f(x) = e^{−x}\). How well does thi...

910 sym Python (526 sym/3 pcs) 1 img

DATA 605: Assignment 4 - Eigenshoes

18.02.2023

Reading in shoe images shoes <- matrix(0, nrow=17, ncol=9000000) files <- list.files("../data/shoes") # Read in each image in our data directory for (i in 1:length(files)){ filepath <- file.path("../data/shoes", files[i]) # Resizing images, otherwise we run into local memory problems as the image matrix becomes too large img <- resizeImage(...

1464 sym Python (1488 sym/9 pcs) 2 img