#### Statistics

**Order Instructions/Description**

#———————————————————————–

#Instructions: for plotting the graphs, please use as much ggplot() as

#you can.

#———————————————————————–

#Question 1. Normal Distribution

#1.1 What is the density of 2, given that it is distributed as normal

# distribution with mean 2 and variance 25?

#1.2 What is the cumulative probability of 2, given that it is distributed

# as normal distribution with mean 2 and variance 25?

#1.3 What is the the probability of 0 <= X <= 3, given that x is normally

#distributed with mean 2 and variance 25

#1.4 Plot the cumulative probability graph of a normal distribution with

# mean 2 and variance 25, and find Q1, Median and Q3 of this distribution.

#[Hint: first generate a numeric vector using

#seq(), and use qnorm to generate the corresponding cumulative probabilities

#of this numeric vector]

#———————————————————————–

#Question 2. Bernoulli Distribution

#2.1 What is the probability of tossing a coin 200 times

#with 140 head?

#2.2 (plot binomial in ggplot):

# A numeric vector is distribuited as binomial distribution

x <- seq(5,15)

#with n=20, p=0.5

#Show the density of x with the ggplot

#———————————————————————–

#Question 3. Geometric Distribution

#Products produced by a machine has a 1.3% defective rate.

#3.1 What is the probability that the first defective occurs

#in the fifth item inspected?

#3.2 What is the probability that the first defective occurs

#in the first two inspections?

#3.3 Generate 100 random samplings for this distribution,

#Find the smaple mean, variance, and graph the samples into a

#histogram plot.

#———————————————————————–

#Question 4. Exponential Distribution

#Given that rate=0.1

#4.1 Draw a graph to show the cumulative probability of 5.

#4.2 Rondomly draw 50,000 observations from this distribution, and calculate

#the sample mean and variance.