first midterm examination - Çankaya...
TRANSCRIPT
Cankaya UniversityDepartment of Computer Engineering
2015 - 2016 Spring Semester
CENG 235 - Introduction To Probability and Statistics
First Midterm Examination
1) You are playing a game. You toss a single die, and
• If it is 6 you win,
• If its 1, 2 or 3, you lose.
If it is 4 or 5, you toss it again.
• If you get a number greater than the first result, you win,
• If you get a number less than or equal to the first result, you lose.
What is your probability of winning this game?
2) There are 4 departments in a University, CENG (Computer Engineering), ECON (Economics),INTT (International Trade) and ELL (English Language and Literature).
20% of the students are from CENG, 25% of the students are from ECON, 40% of thestudents are from INTT and 15% of the students are from ELL departments.
10% of the CENG students, 30% of the ECON students, 100% of the INTT students and70% of the ELL students have taken a German language course.
We randomly choose a student from the University, and see that he/she has taken aGerman language course.
What is the probability that he/she is from CENG department?
3) Consider the triangular region R on the plane between x−axis and the lines x = 1 and y = x.A joint probability density function is defined as:
f(x, y) =
{8xy (x, y) ∈ R
0 elsewhere
Find the marginal distributions g(x) and h(y). Are X and Y statistically independent?
4) The probability density function of the discrete random variable X is given as:
x 0 1 2 5 7
f(x) 0.23 0.27 0.40 0.05 0.05
Calculate the variance. (σ2).
5) We are playing a game with the computer. We press a button, and the computer shows a Redcolor with probability 0.2, Black color with probability 0.7 and White color with probability 0.1.We play this game 8 times. What is the probability that we get
a) 4 Red, 3 Black and 1 White?
b) At most 1 Red?
Answers
1)1
6+
1
6· 1
3+
1
6· 1
6=
1
4
2)0.2× 0.1
0.2× 0.1 + 0.25× 0.3 + 0.40× 1 + 0.15× 0.7= 0.0333
3) The integration region is:
O
1
1
x
y
x = y
g(x) =
∫ x
0
8xy dy
= 4xy2∣∣∣∣x0
= 4x3
h(y) =
∫ 1
y
8xy dx
= 4x2y
∣∣∣∣1y
= 4(y − y3)
g(x) · h(y) 6= f(x, y) ⇒ No, they are dependent.
4) µ = 0× 0.23 + 1× 0.27 + 2× 0.40 + 5× 0.05 + 7× 0.05 = 1.67
σ2 = 12 × 0.27 + 22 × 0.40 + 52 × 0.05 + 72 × 0.05− 1.672 = 2.7811
5) a)8!
4! 3! 1!0.24 0.73 0.1 = 0.0154
b) 0.88 +
(8
1
)0.87 0.2 = 0.5033
Cankaya UniversityDepartment of Computer Engineering
2015 - 2016 Spring Semester
CENG 235 - Introduction To Probability and Statistics
Second Midterm Examination
1) In a faculty, there are 4 departments: CENG, ECE, IE and ME. There are 70 students in CENG,80 students in ECE, 65 students in IE and 42 students in ME departments. We randomlychoose 8 students.
a) What is the probability that there are 2 students from each department?
b) What is the probability that there are 5 students from CENG department and 3 fromother departments?
2) The probability that a radioactive material will emit a particle during any one-second interval is0.125. We observe that during one minute interval, n particles are emitted. Find the probabilitythat
a) n = 8
b) 12 6 n 6 24
c) n = 25 (Answer must contain 8 digits)
3) A large number of apples arrive at a fruit packaging plant. The average diameter of apples is8.2 cm and the standard deviation is 0.7 cm. The size distribution is normal.
The apples are divided into three groups: The top 15% is Large, the bottom 15% is Small,and the remaining ones are Medium.
What are the size limits in terms of cm?
4) A customer coming into a coffee shop orders coffee with milk with p = 0.65 and black coffeewith p = 0.35. What is the probability that of the next 1000 customers, the number of thosewho want black coffee are in the range [320, 330]?
5) Let X be a random variable having gamma distribution with parametersα = 2, β = 7. Find the probability that P (10 < X < 20).
Hint: You may use the following formulas:∫x2eax dx = eax
(x2
a− 2x
a2+
2
a3
)+ c∫
xeax dx = eax(x
a− 1
a2
)+ c
Answers
1) 70 + 80 + 65 + 42 = 257
(70
2
)(80
2
)(65
2
)(42
2
)(
257
8
) = 0.0323
80 + 65 + 42 = 187
(70
5
)(187
3
)(
257
8
) = 0.0307
2) a) Using Poisson distribution with λ = 60× 0.125 = 7.5, we obtain
e−7.5 7.58
8!= 0.1373 6 pts.
b) Using Poisson Table and assuming 12 6 n,
1− 0.9208 = 0.0792 8 pts.
c) We can not use table here, so using the formula:
e−7.5 7.525
25!= 2.68× 10−7 = 0.00000027 6 pts.
3)
P (z < z2) = 0.85 ⇒ z2 = 1.04
P (z < z1) = 0.15 ⇒ z1 = −1.04
Using z =x− µσ
x2 = 8.2 + 1.04× 0.7 = 8.928
x1 = 8.2− 1.04× 0.7 = 7.472
So size limits are:
Small if x < 7.472Medium if 7.472 < x < 8.928Large if 8.928 < x
4) We have to use normal approximation to binomial
µ = 0.35× 1000 = 350
σ =√
1000× 0.35× 0.65 = 15.08
z1 =319.5− 350
15.08= −2.02 10 pts.
z2 =330.5− 350
15.08= −1.29
P (−2.02 < z < −1.29) = 0.0985− 0.0217
= 0.076810 pts.
5)
P (10 < x < 20) =
∫ 20
10
xe−x/7
72Γ(2)dx
=1
49
[e−x/7
(− 7x− 49
)] ∣∣∣∣2010
= 0.3605
Cankaya UniversityDepartment of Computer Engineering
2015 - 2016 Spring Semester
CENG 235 - Introduction To Probability and Statistics
Final Examination
1) The probability that you pass an examination in first trial is 0.70. If you fail, you are given asecond chance. But this time the exam is more difficult, so your probability of passing is 0.50.If you fail this one too, you are given a third and last chance. Your probability of passing thethird exam is 0.30. If you fail the third exam, you repeat the course.
a) At the beginning of the semester, Merve says: ”I think I will repeat the course”. Whatis the probability of that?
b) At the beginning of the semester, Sumeyye says: ”I think I will pass, but at the thirdexam”. What is the probability of that?
c) At the end of the semester, Ece says: ”I passed” but does not give any details. Whatis the probability she passed at the second exam?
2) We are using an integer random number generator. If the number it gives is a multiple of 3,we reject it, else, we accept it. We need to accept 5 times to finish this job.
a) What is the probability job is finished after exactly 10 trials?
b) What is the probability job is finished after 7 or fewer trials?
3) There are 50 000 products and we know that 10 000 of them are defective. We will randomlychoose 40 products. What is the probability that exactly 8 are defective? (Hint: Use anapproximation)
4) A population is distributed normally with µ = 418.5 and σ = 57.6. This population is dividedinto five groups, A,B,C,D, F as shown in the figure.
Find x1 and x2. (The lower and upper limits for D)
0.19 (D)
0.14 (F )
0.67 (A,B,C)
x1 x2 µ
5) A researcher, trying to determine the average of a population, obtains a sample of 12 unitswith the following values:
{97, 86, 86, 102, 123, 88, 97, 102, 79, 106, 87, 93}
The population standard deviation is known to be σ = 11.84. She finds a confidence intervalof [90.92, 100.08] for the population average µ.
What is the confidence level she is using?
Answers
1) We can calculate probabilities as follows:
Pass at first exam: 0.7
Pass at second exam: 0.3× 0.5 = 0.15
Pass at third exam: 0.3× 0.5× 0.3 = 0.045
Fail: 0.3× 0.5× 0.7 = 0.105
Therefore:
a) 0.105 5 pts.
b) 0.045 5 pts.
c)0.15
0.7 + 0.15 + 0.045= 0.1676 10 pts.
2)
a)
(9
4
)(2
3
)5(1
3
)5
= 0.0683
b)
(2
3
)5
+
(5
4
)(2
3
)5(1
3
)+
(6
4
)(2
3
)5(1
3
)2
= 0.5706
3) Binomial approximation to hypergeometric distribution gives:
p =10000
50000= 0.2, q = 1− p = 0.8
Therefore the probability of 8 defectives in 40 trials is:(40
8
)0.28 0.832 = 0.1560
4) Using the normal distribution table, we find:
P (z < z1) = 0.14 ⇒ z1 = −1.08
P (z < z2) = 0.14 + 0.19 = 0.33 ⇒ z2 = −0.44
−1.08 =x1 − 418.5
57.6⇒ x1 = 356.292
−0.44 =x2 − 418.5
57.6⇒ x2 = 393.156
5) x = 95.5
zα/2 =100.08− 95.5
11.84/√
12= 1.34
P (z < 1.34) = 0.91
1− 0.91 = 0.09
0.91− 0.09 = 0.82
⇒ Confidence Level is: 82%
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 24.02.2016
ID Number:
CLASSWORK 1
1) In a city, it rains with 0.25 probability and it snows with 0.10 probability on any given day.If it rains, there’s heavy traffic with 0.6 probability. If it snows, there’s heavy traffic with 0.9probability. If it does not rain or snow, there’s heavy traffic with 0.2 probability.Today there’s heavy traffic. What is the probability it is raining?
Answer:
Rain Snow Nothing
Heavy Traffic 0.15 0.09 0.13
Normal Traffic 0.10 0.01 0.52
P (Rain | Heavy Traffic) =0.15
0.15 + 0.09 + 0.13= 0.4054
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 24.02.2016
ID Number:
CLASSWORK 1
1) In a city, it rains with 0.25 probability and it snows with 0.10 probability on any given day.If it rains, there’s heavy traffic with 0.6 probability. If it snows, there’s heavy traffic with 0.9probability. If it does not rain or snow, there’s heavy traffic with 0.2 probability.
a) What is the probability of heavy traffic on any given day?
b) Are the events of heavy traffic and rain independent? Explain.
Answer:
Rain Snow Nothing
Heavy Traffic 0.15 0.09 0.13
Normal Traffic 0.10 0.01 0.52
P (Heavy Traffic) = 0.25× 0.6 + 0.1× 0.9 + 0.65× 0.2 = 0.37
P (HT) = 0.37, P (HT | R) = 0.60 ⇒ P (HT) 6= P (HT | R)
These events (Heavy Traffic and Rain) are dependent.
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 02.03.2016
ID Number:
CLASSWORK 2
Is the following function a probability density function?
f(x) =
1− x2 −1 6 x < 0
1− x 0 6 x 6 1
0 elsewhere
Answer:
∫ ∞−∞
f(x) dx =
∫ 0
−1(1− x2) dx+
∫ 1
0
(1− x) dx
= x− x3
3
∣∣∣∣∣0
−1
+ x− x2
2
∣∣∣∣∣1
0
=2
3+
1
2
=7
6
No, the function is not a probability density function, because
∫ ∞−∞
f(x) dx 6= 1
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 02.03.2016
ID Number:
CLASSWORK 2
Is the following function a probability density function?
f(x) =
− x5
−2 6 x < −1
0.2 −1 6 x 6 1
x
51 6 x 6 2
0 elsewhere
Answer:
∫ ∞−∞
f(x) dx =
∫ −1−2− x
5dx+
∫ 1
−10.2 dx+
∫ 2
1
x
5dx
= − x2
10
∣∣∣∣∣−1
−2
+x
5
∣∣∣∣∣1
−1
+x2
10
∣∣∣∣∣2
1
=3
10+
4
10+
3
10
= 1
Yes, the function is a probability density function, because f(x) > 0 and
∫ ∞−∞
f(x) dx = 1
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 09.03.2016
ID Number:
CLASSWORK 3
The joint probability function for X and Y is given as:
f(x, y) =
24xy
0 < x, 0 < yx+ y < 1
0 elsewhere
Verify that f(x, y) is actually a probability function.
Answer:
The integration region is triangular as seen in the figure:
O
1
1
x
y
x+ y = 1
∫ ∞−∞
∫ ∞−∞
f(x, y) dydx =
∫ 1
0
∫ 1−x
0
24xy dydx
=
∫ 1
0
12xy2∣∣∣∣1−x0
dx
=
∫ 1
0
12x(1− x)2 dx
= 6x2 − 8x3 + 3x4∣∣∣∣10
= 1
Also, f(x, y) > 0. Therefore f(x, y) is a probability density function.
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 09.03.2016
ID Number:
CLASSWORK 3
The joint probability function for X and Y is given as:
f(x, y) =
24xy
0 < x, 0 < yx+ y < 1
0 elsewhere
Find the probability that x+ y <1
2.
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 23.03.2016
ID Number:
CLASSWORK 4
Suppose an ordinary deck of playing cards is shuffled, a card is drawn randomly, and then putback in the deck (replaced). This is repeated 14 times. What is the probability of drawing
a) 4 spades, 2 hearts, 5 diamonds and 3 clubs?
b) 10 or 11 hearts?
Note that:
♣ is club
♦ is diamond
♠ is spade
♥ is heart
and there are 13 of each types, with a total of 52 cards in a standard deck.
Answer:
a)14!
4! 2! 5! 3!
(13
52
)4 (13
52
)2 (13
52
)5 (13
52
)3
= 2 522 520× 0.2514
= 9.3971× 10−3 = 0.0094
b)
(14
10
)0.2510 0.754 +
(14
11
)0.2511 0.753
= 3.3866× 10−4 = 0.0003
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 23.03.2016
ID Number:
CLASSWORK 4
Suppose an ordinary deck of playing cards is shuffled, a card is drawn randomly, and then putback in the deck (replaced). This is repeated 11 times. What is the probability of drawing
a) 3 spades, 1 heart, 5 diamonds and 2 clubs?
b) 8 or 9 hearts?
Note that:
♣ is club
♦ is diamond
♠ is spade
♥ is heart
and there are 13 of each types, with a total of 52 cards in a standard deck.
Answer:
a)11!
3! 1! 5! 2!
(13
52
)3 (13
52
)1 (13
52
)5 (13
52
)2
= 27 720× 0.2511
= 6.6090× 10−3 = 0.0066
b)
(11
8
)0.258 0.753 +
(11
9
)0.259 0.752
= 1.1802× 10−3 = 0.0012
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 30.03.2016
ID Number:
CLASSWORK 5
We are making an experiment where the probability of success is 0.8. What is the probabilitythat we reach our 3rd success in:
a) 3-4 trials?
b) 5th trial?
c) 6th or more trials?
Answer:
a) 0.83 +
(3
2
)0.83 0.2 = 0.8192
b)
(4
2
)0.83 0.22 = 0.1229
c) 1−(
0.8192 + 0.1229)
= 0.0579
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 06.04.2016
ID Number:
CLASSWORK 6
You put 350 chocolate chips into dough, mix well, and make 100 cookies. You choose a cookierandomly. What is the probability of finding 3 or more chocolate chips in it? Answer using:
a) Binomial distribution.
b) Poisson distribution.
Answer:
a) 1−[0.99350 +
(350
1
)0.99349 0.011 +
(350
2
)0.99348 0.012
]= 0.6805
b) µ =350
100= 3.5
P (3 6 x) = 1− P (x 6 2)
= 1− 0.3208
= 0.6792
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 13.04.2016
ID Number:
CLASSWORK 7
The average of an exam is µ = 238.6 and the standard deviation is σ = 42.3. Assumethere are a large number of students and the grades are normally distributed.
The students in the bottom 10% get FF, the 20% just above them get DD. What are thelimits for DD?
Answer:
Let’s use x for grades and z for standardized grades.
P (z < z1) = 0.10 ⇒ z1 = −1.28
P (z < z2) = 0.10 + 0.20 = 0.30 ⇒ z2 = −0.52
We know that
z =x− µσ
⇒ x = µ+ zσ
So lower and upper limits for DD are:
x1 = 238.6− 1.28× 42.3 = 184.5
x2 = 238.6− 0.52× 42.3 = 216.6
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 13.04.2016
ID Number:
CLASSWORK 7
There are a total of 1520 students entering an exam and 548 of them get CC. The teachersays
• The grades are normally distributed.
• The students who got CC are in the symmetric middle.
• Grades for CC limits are: [458.9, 495.1].
Find the average (µ) and the standard deviation (σ) of grade distribution.
Answer:
548
1520= 0.3605
0.3605
2+ 0.5 = 0.6803
P (z < k) = 0.6803 ⇒ k = 0.47
This means, if we move 0.47 standard deviations from the middle to both left and right, wewill have an interval that contains 36% of all observations.
µ =458.9 + 495.1
2= 477
σ =495.1− 477
0.47= 38.5
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 27.04.2016
ID Number:
CLASSWORK 8
The waiting time for a job in a computer system is exponentially distributed with mean of 9ms. What is the probability that the next two jobs both wait more than 12 ms?
Answer:
P (12 < t) =
∫ ∞12
e−t/9
9dt
= −e−t/9∣∣∣∣∞12
= 0.2636
This is the probability for one event. For two events, the probability is:
0.26362 = 0.0695
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 27.04.2016
ID Number:
CLASSWORK 8
The waiting time for a job in a computer system is exponentially distributed with mean of 75ms. What is the probability that a particular job waits more than 60 but less than 80 ms?
Answer:
P (60 < t < 80) =
∫ 80
60
e−t/75
75dt
= −e−t/75∣∣∣∣8060
= −e−80/75 + e−60/75
= 0.1052
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 04.05.2016
ID Number:
CLASSWORK 9
A researcher is given a sample of 129 units. The sample average is X = 37.80 and thepopulation standard deviation is σ = 5.9. He finds a confidence interval of [37.03, 38.57] forthe population average µ. What is the confidence level the researcher is using?
Answer:
37.80− 37.03 = 0.77
0.77 = zα/2 ·5.9√129
⇒ zα/2 = 1.48
Using the table,
P (z < 1.48) = 0.93
1− 0.93 = 0.07
0.93− 0.07 = 0.86
Confidence level: 86%
Cankaya University
Department of Computer Engineering
CENG 235 - Introduction To Probability and Statistics
Name-Surname: 04.05.2016
ID Number:
CLASSWORK 9
A researcher knows that the population standard deviation is σ = 37 and she wants to determinethe population average µ. She wants to determine an interval of size at most 5 (half size 2.5)with a confidence level of 92%. What is the sample size she needs?Answer:
37.80− 37.03 = 0.77
1− α = 0.92
α = 0.02, α/2 = 0.04
Using the table,
zα/2 = 1.75
1.75 · 37√n
6 2.5
25.9 6√n
670.81 6 n
Sample size must be:
671 6 n
Author: Dr. Emre Sermutlu
June 23, 2016