You are on page 1of 5

INTRODUCTION TO QUANTITATIVE ANALYSIS.

LEONARDO D. VILLAMIL.
HW3
10/10/2016
THE SET UP.
Set the working directory.
setwd("E:/leonardo/education/gsu/introQuantitativeAnalysis/hw/hw3")
getwd()
#!!Passed
Set your data frame. The original file was re-name to df.csv.
df = read.csv("dates.csv")
!!File is up!!

To facilitate numeric manipulation


x=df$days_after
# !!Good.
plot(density(x))

!! UhmmmInteresting.

The sample normality !!. Uhmm?


The packages:
qqnorm(x)
qqline(x)

!! This guy is not so normal !!


install.packages("moments")
library(moments)
# !! loaded !!
mean(x)
35.21818

sd(x)
35.03897

skewness(x)
2.196399

kurtosis(x)
8.20818

Confidence interval.
install.packages("Rmisc")
library(Rmisc)
CI(x,ci=0.95)
upper mean lower
44.69054 35.21818 25.74582
(44.7, 25.7)
Assumptions for probability problems.
I do distinguish between two cars of the same color.
I disregarded the probabilities of what color car passed first. i.e Yellow and White
or white and yellow is the same pair. What color car passes first will change the
set up.
If one car pass, this car is not replacement into the group.

In problem 3a I have a question. I want to find out where my reasoning error is?
If I go with the sample space I have 20 x 15 = 300 ways in which the event (Yellow &
White can Happen). The number of cases for the sample space is 100C2 = 4950.
According with the classical probability definitions the P(YW) = 300/4950 = 0.060.
Now if I go with the probability rules:
Conditional: P(YW) = P(Y) X P(W|Y) = 0.15 X (20/99) = 0.030.
The events are not independent. Because once a car pass there are only 99 cars
remaining, unless the car is replace in the group of 100.
If we assume they are independent then P(YW) = 0.15 X 0.20 = 0.03. In any case the
answers are equal.
For the purpose of the homework my answer will be the one obtained using conditional
probability which is 0.030.
But, may you tell me what is wrong with the answer obtained using the sample space? if
nothing is wrong why the two answers are different?

3C.
Using sample space:

Using probability rules:

P(First Car is not yellow) _= 85/100. P(Second car is not yellow) = 84/99
P(First car is not yellow And Second car is not yellow) = (85/100) x (84/99) = 0.7212

You might also like