Publications by Mohamed Hassan-El Serafi

Data 605 HW13

27.11.2023

1. Use integration by substitution to solve the integral below. \[ \int { 4{ e }^{ -7x }dx } \] Selecting \(u\) to be the \(g(x)\) inside \(f(g(x))\) \[ u=-7x\\ du=-7dx\\ -\frac{du}{7}=dx \] Substitute \(dx\) with \(du\) (reverse chain rule) \[ \frac{-4}{7} \int { { e }^{ u }du } \\ = \frac{-4}{7}e^{u}+C\\ = \frac{-4}{7}e^{-7x}+C \] Answer: \(\frac...

3864 sym 3 img

Data 605 HW12

20.11.2023

1. Provide a scatterplot of LifeExp~TotExp, and run simple linear regression. Do not transform the variables. Provide and interpret the F statistics, R^2, standard error,and p-values only. Discuss whether the assumptions of simple linear regression met. library(tidyverse) data <- read.csv("/Users/mohamedhassan/Downloads/who.csv") summary(data) ## ...

5744 sym R (5756 sym/31 pcs) 19 img

Data 605 Discussion 12

15.11.2023

library(tidyverse) library(GGally) set.seed(123) data1 <- read_csv("/Users/mohamedhassan/Downloads/Sleep_Efficiency.csv") summary(data1) ## ID Age Gender ## Min. : 1.0 Min. : 9.00 Length:452 ## 1st Qu.:113.8 1st Qu.:29.00 Class :character ## Median :226.5 Median :40.00 Mode :chara...

173 sym R (10737 sym/27 pcs) 6 img

Data 605 HW11

13.11.2023

Using the “cars” dataset in R, build a linear model for stopping distance as a function of speed and replicate the analysis of your textbook chapter 3 (visualization, quality evaluation of the model, and residual analysis.) library(tidyverse) summary(cars) ## speed dist ## Min. : 4.0 Min. : 2.00 ## 1st Qu.:12.0 ...

2223 sym R (1737 sym/17 pcs) 14 img

Data 605 HW10

06.11.2023

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 .4 and loses A dollars with probability .6. Find the probability that he wins 8 dollars before losing all of his money if: (a) he bets 1 dollar each time (timid...

936 sym

Data 605 HW9

30.10.2023

Page 363, Question 11 The price of one share of stock in the Pilsdorff Beer Company (see Exercise 8.2.12) is given by \(Y_n\) on the nth day of the year. Finn observes that the differences \(X_n = Y_n+1\) − \(Y_n\) appear to be independent random variables with a common distribution having mean \(µ\) = 0 and variance \(σ^2\) = 1/4. If \(Y_1\) =...

2141 sym

Data 608 Story 4

24.10.2023

library(chromote) library(htmltools) library(rvest) library(readxl) library(plotly) library(leaflet) library(sf) library(ggplot2) library(maps) library(RColorBrewer) # lots of color palettes for these kind of charts library(data.table) # for sorting by key library(mapproj) #coord_maps() needed this #library(lattice) #library(vegalite) library(tidyv...

2238 sym R (21776 sym/74 pcs) 9 img

Data 605 HW8

23.10.2023

Page 303 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? light_bulbs <- 100 lifetime <- 1000 lambda_rate <- light_bulbs/lifetime 1/lambda_rate ## [1] 10 Assume that X1 and X2 are independent random variables, each having an exponential de...

1552 sym

Data 608 Story 4

23.10.2023

library(chromote) library(htmltools) library(rvest) library(readxl) library(plotly) library(leaflet) library(sf) library(ggplot2) library(maps) library(RColorBrewer) # lots of color palettes for these kind of charts library(data.table) # for sorting by key library(mapproj) #coord_maps() needed this #library(lattice) #library(vegalite) library(tidyv...

2240 sym R (21833 sym/75 pcs) 9 img

Data 605 HW7

16.10.2023

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. I’ll use an example where \({X1, X2, X3, X4}\) will be the number of independent random variables, \(n = 4\), uniformly distributed on integers ...

2530 sym