본문 바로가기

Coursera/Mathematics for ML and Data Science

Probability & Statistics for Machine Learning & Data Science (9)

728x90

Introduction to Probability and Probability Distributions

Check your knowledge

Q1

When throwing a dice twice, what is the probability of getting exactly two 5's? (What is Probability?, What is Probability? - Dice example)

Answer

더보기

1/36 = 1/6 * 1/6

Q2

When throwing five dice and summing the result, what is the probability of obtaining a value greater than 5? (Complement of Probability)

Answer

더보기

$({5\over6})^5 = 1 - ({1\over6})^5$

The probability of getting 5 from throwing five dice is $({1\over6})^5$ and we use the complement rule and subtract it from 1.

Q3

When throwing a dice, what is the probability of getting an odd number or 1? (Sum of Probabilities)

Answer

더보기

1/2

1 falls within the event of getting an odd number, so we count the probability of getting an odd number.

728x90

Q4

What is the probability of getting an odd number or a prime number when throwing one dice? (Sum of Probabilities - Joint Events)

Answer

더보기

2/3

Odd number probability = 1/2

Prime number probability = 1/2

Sum of probability for join events = 1/2 + 1/2 - 2/6 = 1 - 1/3 = 2/3

Q5

A factory produces two types of products: Type A and Type B. It is known that 70% of the total products are Type A, while the remaining 30% are Type B. The factory has a quality control system that can correctly identify Type A products with a probability of 80% and Type B products with a probability of 90%.

If a randomly selected product is tested and found to be of high quality (passed the quality control system), what is the probability that it is Type A? (Bayes Theorem - Intuition, Bayes Theorem - Mathematical Formula)

Answer

더보기

82.88%

 

P(A) = 70% and P(B) = 30%

Table for Bayes Theorem

  Pass (80% for A, 90% for B) Fail (Complement of Pass)
Type A (70%) 56% 44%
Type B (30%) 27% 73%

P(pass | A) = 56%

P(fail | A) = 44%

P(pass | B) = 27%

P(fail | B) = 73%

 

Following the math formula:

P(A | pass) = P(A) * P(pass | A) / P(pass)

Here the numerator is P(A) * P(pass | A) and the denominator is all the passed products, P(A) * P(pass | A) + P(B) * P(pass | B).

And our formula becomes:

P(A | pass) = P(A) * P(pass | A) / ( P(A) * P(pass | A) + P(B) * P(pass | B))

Substituting variables into numbers:

P(A | pass) = 70% * 56% / (70% * 56% + 30% * 27%) = 39.2% / (39.2% + 8.1%) = 82.88%

Q6

When flipping a coin 10 times, you want to investigate how many heads will show up on average. How can you define a random variable to work with this problem? (Random Variables)

Answer

더보기

P(H) when H means number of heads from a coin flip or P(X = number of heads from 10 coin flips)

Q7

You throw 10 dice and observe how many even numbers show up. Which random variable and parameters can describe this situation? (Probability Distributions (Discrete), Binomial Distribution)

Answer

더보기

$X \sim \operatorname{Binomial}(10, 1/2)$

We use $X \sim \operatorname{Binomial}(n, p)$, where n (number of throws), p (probability of getting even numbers) is equal to n = 10, p = 1/2.

Q8

For the given distributions, write down their Probability Density Functions:

  • Uniform[0,5]
  • Normal(5,1)

(Probability Distributions (Continuous), Probability Density Function, Uniform Distribution, Normal Distribution)

Answer

더보기

For the uniform distribution, the PDF is $f(x) = {1\over5} = {1 \over (5 - 0)} = {1 \over (b - a)}$

For the normal distribution, the PDF is $f(x)={1\over \sqrt{2\pi}}e^{-{1\over2}({x-5 \over 1})^2}$

All the information provided is based on the Probability & Statistics for Machine Learning & Data Science | Coursera from DeepLearning.AI

728x90