Publications by Justin Williams

Sum of Random Variables/Law of Large Numbers

19.03.2023

Question 1 A company buys 100 lightbulbs, each of which has an exponential lifetime of 1000 hours. What is the expected time for the first of these bulbs to burn out? (See Exercise 10.) The density of minimum value among \(n\) independent random variables with an exponential density has mean \(\frac{\mu}{n}\), where \(\mu\) is mean of exponential d...

838 sym

Important Distributions

12.03.2023

Question 1 Let X1, X2, . . . , Xn be n mutually independent random variables, each of which is uniformly distributed on the integers from 1 to k. Let Y denote the minimum of the Xi’s. Find the distribution of Y. Y denotes the minimum of the \(Xi\)’s, such that each independent random variable \(Xi\) has \(k\) possibilities. Suppose that each \(...

2419 sym

Combinatorics and Conditional Probability

04.03.2023

Question 1 A bag contains 5 green and 7 red jellybeans. How many ways can 5 jellybeans be withdrawn from the bag so that the number of green ones withdrawn will be less than 2? We can use the binomial coefficient formula to calculate: \[\left(\begin{array}{l} n \\ j \end{array}\right)=\frac{n !}{j !(n-j) !}\] There are two ways this can happen: ch...

4889 sym Python (3210 sym/44 pcs)

Probability distributions

27.02.2023

Question 1 (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 d...

5252 sym Python (3346 sym/66 pcs)

Eigenshoes

19.02.2023

library(jpeg) library(OpenImageR) library(graphics) library(tidyverse) library(reshape2) library(imager) Assignment Build and visualize eigenimagery that accounts for 80% of the variability Read data Import zipped jpeg and read into R as a matrix. # unzip folder unzip("jpg.zip") # create list of files file_list <- list.files("jpg", pattern = "*....

1323 sym R (3641 sym/16 pcs) 7 img

Rank of Matrix / Eigenvalues

13.02.2023

library(Matrix) Problem Set 1 What is the rank of the matrix \(A\)? \[ A=\left[\begin{array}{cccc} 1 & 2 & 3 & 4 \\ -1 & 0 & 1 & 3 \\ 0 & 1 & -2 & 1 \\ 5 & 4 & -2 & -3 \end{array}\right] \] To find the rank of a matrix, we will transform that matrix into its echelon form. Then determine the rank by the number of non-zero rows. We can apply the f...

3398 sym R (704 sym/8 pcs)

Initial transformation

02.02.2023

library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ── ## ✔ ggplot2 3.3.6 ✔ purrr 0.3.5 ## ✔ tibble 3.1.8 ✔ dplyr 1.0.10 ## ✔ tidyr 1.2.1 ✔ stringr 1.5.0 ## ✔ readr 2.1.3 ...

2068 sym R (2760 sym/18 pcs) 5 img

Final Project

24.01.2022

Eniviromental Sustainability Index 2005 Introduction The 2005 Environmental Sustainability Index (ESI) benchmarks the world’s nations ability to protect the environment over the next few decades. 146 Countries were given an ESI, made up of 21 indicators in several different environmental areas. These 21 indicators were tallied on a z-score sca...

4403 sym R (7448 sym/30 pcs) 9 img 1 tbl

R Bridge Week 1 Assignment

07.01.2022

Question 1 Write a loop that calculates 13-factorial. Bonus - try to do it two different ways (for example use a for loop and a while loop). Do not use the standard factorial function. The goal is to learn about how R uses loops. While Loop mynum <- 13 mynum_fac <- 1 while (mynum>1) { mynum_fac <- mynum*mynum_fac mynum <- mynum-1 } print(pas...

617 sym R (871 sym/9 pcs)

R Bridge Week 2 Assignment

13.01.2022

R Bridge Course Week 2 Assignment Select a dataset from http://vincentarelbundock.github.io/Rdatasets/ download it and perform the following tasks: library(readr) iceCore <- read_csv("https://raw.githubusercontent.com/justinm0rgan/bridge-workshop/main/R/hw2/edcCO2.csv?token=GHSAT0AAAAAABPMFD5D4X2BPT6CJAYMB3F6YPAN2QA", col_select = c(2,3), ...

2383 sym R (2598 sym/22 pcs)