Publications by Habib Khan
Data 605 - Assignment 9
Problem 1 # (a) a <- pnorm(100, mean=100, sd = sqrt(0.25*364), lower.tail = FALSE) a ## [1] 0.5 # (b) b <- pnorm(110, mean=100, sd = sqrt(0.25*364), lower.tail = FALSE) b ## [1] 0.1472537 # (c) c <- pnorm(120, mean=100, sd = sqrt(0.25*364), lower.tail = FALSE) c ## [1] 0.01801584 Problem 2 Problem 3 ...
44 sym R (273 sym/6 pcs) 3 img
Working with ggplot2
Part I The Grammar of Graphics - ggplot2 Elements Description Data The dataset being plotted Aesthetics Scale onto which we map our data Geometries Visual elements used for our data Themes All non-data ink Statistics Representation of our data to aid understanding Coordinates The space on which the data will be plotted...
735 sym R (6056 sym/46 pcs) 40 img 3 tbl
Data 605 - Week 8 Discussion
# if p = 0 zero <- 1/8 * 1/8 zero ## [1] 0.015625 # if p = 1 one <- 1/8 * 3/8 + 3/8 * 1/8 one ## [1] 0.09375 # if p = 2 two<-1/8 * 1/2 + 3/8 * 3/8 + 1/2 * 1/8 two ## [1] 0.265625 # if p = 3 three<- 3/8 * 1/2 + 1/2 * 3/8 three ## [1] 0.375 # if p = 4 four <- 1/2 * 1/2 four ## [1] 0.25 ...
6 sym R (285 sym/10 pcs) 1 img
Data 605 - Week 7 Discussion
knitr::include_graphics('7.png') # (a) # Let's find out the probability of no one having this blood type in a city of 10,000 people exp(1)^(-10)*100 ## [1] 0.004539993 Probability for no one having this blood type is 0.00453% in a city of 10,000 people (b) round(1000*log(2),0) ## [1] 693 ...
103 sym R (192 sym/5 pcs) 1 img
Data 605 - Assignment 7
Problem 7.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 . The function for Y = Min(X1, X2,… Xn) = Xi, where Xi is the minimum value for all independent random variables We can model the fu...
769 sym R (535 sym/21 pcs) 1 img
Data 605 - Week 6 Discussion
Problem 1 - Page 88 Four people are to be arranged in a row to have their picture taken. In how many ways can this be done? Position 1 can be taken by all 4 persons, position 2 by 3, position 3 by 2 person and position 4 by 1 person. factorial(4) ## [1] 24 This can be done in 24 ways. ...
270 sym R (21 sym/2 pcs)
Data 605 - Week 5 Discussion
Exercise 1 from Chapter 3 knitr::include_graphics('5-1.png') choose(6,3) ## [1] 20 choose(5,4)*(1/5)**4*(4/5) ## [1] 0.0064 choose(7,2) ## [1] 21 choose(26,26) ## [1] 1 choose(4,3)*(1/5)**3*(4/5) ## [1] 0.0256 choose(6,2) ## [1] 15 choose(10,9) ## [1] 10 choose(8,5)*(.3)**5*(.7)**3 ## [1] 0.04667544 ...
58 sym R (258 sym/17 pcs) 1 img
Data 605 - Assignment 5
Introduction Choose independently two numbers B and C at random from the interval [0, 1] with uniform density. Prove that B and C are proper probability distributions. Note that the point (B,C) is then chosen at random in the unit square. B <- runif(1000) C <- runif(1000) Checking if B and C are probability distributions hist(B, probability = T...
492 sym R (558 sym/13 pcs) 2 img
Data 605 - Assignment 4
knitr::include_graphics('4-1.png') # Creating matrix A A <- matrix(c(1,-1,2,0,3,4), nrow=2, ncol=3) A ## [,1] [,2] [,3] ## [1,] 1 2 3 ## [2,] -1 0 4 # Transformation X <- A %*% t(A) X ## [,1] [,2] ## [1,] 14 11 ## [2,] 11 17 Y <- t(A) %*% A Y ## [,1] [,2] [,3] ## [1,] 2 2 -1 ## [2,] ...
245 sym R (2401 sym/26 pcs) 2 img
Data 605 - Assignment 3
Problem 1 knitr::include_graphics('3-1.png') 1.1 # Reading library library(matrixcalc) # Feed the data into R A <- matrix(c(1,-1,0,5,2,0,1,4,3,1,-2,-2,4,3,1,-3), nrow=4, ncol=4) A ## [,1] [,2] [,3] [,4] ## [1,] 1 2 3 4 ## [2,] -1 0 1 3 ## [3,] 0 1 -2 1 ## [4,] 5 4 -2 -3 # Calculating ra...
183 sym R (1122 sym/16 pcs) 2 img