Data Science Classroom Series – 30/Nov/2021

Terms

  • Sample Space: The set of all possible values of a random variable is called as sample space
    • Examples: Sample space for
      • die roll S = {1,2,3,4,5,6}
      • Coin Flip S = { H, T }
  • Cardinality of Set: The size of the elements in a set is called as cardinality

Probability

  • How likely an event is to occur

  • Probability of an event is a number that is

    • A value between 0 and 1
    • O corresponds to "unlikely" or almost never
    • 1 correspons to "almost surely"
  • Represent P(event) = value

  • Probability is sometime expressed as percentage (0% and 100%)

  • Rules of Probabilty

    • Probability of event A is greater than or equal to zero P(A) >= 0
    • Probability of Sample Space is one P(S) = 1
    • If A1,A2,A3 … are the sequence of mutually exclusive events
    P(A1 U A2 U A3 U....) = U A(i) = Σ P(A )
                                          i 
    
  • Examples: Consider a Coin Flip

    • S = { H, T}
    • P(H) = P(T) = 1/2
    • P(H and tail) = 0
    • P(H or T) = P(S) = 1
  • Discrete Vs Continuous Probability

    • Discrete = finite set of unique values
      • Coin toss, die roll, number of cars in house hold
      • P(E) = 1/N where N is number of possible Events
    • Continuous = infinite set of values
      • Person height, amount of rainfall in a day
      • Instead, better to measure intervals
  • Counting Methods

    • Counting Simple Points
      • Consider a coin Flip S = {H, T}
      • Flip a coin 3 Three times (Sampling with replacement) How many different arrangements are possible?
        • Direct approach: list all the arrangements and count them
        HHH, HHT, HTH, HTT, THH, THT, TTH, TTT
        
        • How many arrangements begin or end with a HEAD
          • S(H??) U (S ??H) = HHH, HHT, HTH, HTT, THH, TTH = 6
    • Multiplication Rule
      • We need to travel from A to C through B Preview
      • Three Ways from A to B AB = {AB(1), AB(2), AB(3) }
      • Two ways to get from B to C BC = { BC(1), BC(2)}
      • How many ways of getting from A to C Preview
      • Clearly number of options is #AB * #BC => 3*2 = 6
  • Example: A container has three balls: Red, Blue, Yellow. You draw each of the balls in turn without replacement. How many possible ways/arrangements are there

    • First draw => 3 possible options
    • Second draw => 2 possible options (one is already draws)
    • Third draw => 1 possible option
    • Total number of possible draws is => 3 * 2 * 1 => 6
  • Permuation:

    • Given a set of elements all distinct arrangement s of the elementes are called the permuatation of a set
    • The number of ways you can arrange N elements of N possibilies
    P(n,n) => N * N-1 * N-2 ....* 2* 1 = N!
    
    • Suppose we have 5 balls (RGBWO) and you draw 3 balls without replacement. How many possible arrangments are there
    5 * 4 * 3 => 60
    
    5 * 4 * 3 * 2 * 1     5!
    ----------------- = -------
          2*1            (5-3)!
    
    • Number of possible arrangements with K elements out of n elements
             n!
    P(n,k)= -----
            n-k!
      Where P represent Permuations
    
    • Example:
      • Number of unique 5 letter words that can be arranged from letters {a,b,c,d,e} => 5^5 (5Pow(5)) => 3125
      • Number of unique letters if each letter appears only once => 5! => 120
      • Number of 3-letter words, each letter repeats only once => P(5,3) => 5!/(5-3)! => 60
  • Combinatorics:

    • Combinatorics is a branch of mathematics concerning the study of finite or countable discrete structures
    • Given a bag of balls B = {R,G,B,W,O}
    • If we pull out 2 balls the number of arrangements => 5!/3! = 20
    • What if we don’t care about order i.e => {R,B} and {B,R} to be same pick, How can we calcualte the number of unique picks
    • The number of picks including duplicates => P(5,2).
    • Each pick has 2! possible arrangments
    • C (n,k) = P(n,k)/k! = n!/(k! * (n-k)!)
    • C(5,2) => 5!/ (3!2!) => (120 / 6 2) => 10
  • Binomial Coeffecients

    • Expressed as Preview
    • Example: You toss a coin 10 times and record the result, What is probability of getting exactly 4 heads
      • Total number of => POW(2,10)
      • Each arrangement is a choice to get 4 heads amount 10 tosses
      C(10,4) 
      
      • P(4 heads) = (C(10,4))/POW(2,10) => 0.205
    • Example: You toss a coin 10 times and record the result, What is probability of getting exactly 4 heads or less Preview
    • The value is 0.377
  • Example: A class has 15 girls and 30 boys. Pick 10 children at random. What the probability that you will pick exactly 3 girls

    • answer: Preview
  • Multinomial Coeffecients:

    • Examples: 10 students need to be formed into 3 groups consisting of 4,3 and 3 members respectively, In how many ways can be student be assigned to these groups
      • First => C(10,4)
      • Second => C(6,3)
      • Third => C(3,3) => 1
      • Number of ways = C(10,4)* C(6,3) Preview
    • In general, number of arrangements of n elements into k groups of size n = {n1,n2,n3 …..} Preview
    • By applying the above formuala => 10!/(4! * 3! * 3!)

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin