Sets, Discrete Probability

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

Math for AI

Boot camp
Discrete Algebra

Prof.A Choudhury 1 04/19/2023


Inquiry

Consider the following two scenarios.


Scenario A: A professor chooses three students to work together on a
problem.
Scenario B: A professor asks three questions in sequence, and each time
calls on a student to answer.
How are the professor’s choices constrained in each scenario? Compare
and contrast.

Mathematical statements deal with groups of objects that share some


property. The simplest way to describe a collection of such related
objects is called a set.

Prof.A Choudhury 2 04/19/2023


Set
A set is a well-defined collection of objects.
As part of a class project, the instructor asked the students of her class to list the
best five books.
Mary's list consisted of 2001: A Space Odyssey, Rendezvous with Rama, A Meeting
with Medusa, The Fountains of Paradise, The Songs of Distant Earth.
Alice's list consisted of The Story of My Life, Dreams from My Father, Wings of Fire,
The Diary of a Young Girl, My Experiments with Truth.
What do you observe?
Why?
Examples:
a) The fingers on your left hand.
b)The residents of your apartment building.
c)The elected members of the Indian parliament.
d)The prescribed text books for your course of study.

Prof.A Choudhury 3 04/19/2023


Notation and representation
 The simplest way of describing a set is to list its elements inside curly brackets { }.
A = {apple, grape, orange, banana, guava}
 Each of these five varieties of fruits constitutes an element of this set A.
 This technique of describing a set by just explicitly writing out all its elements is called the Roster
Method.
 If a set has large number of elements then we just write few elements.
 For e.g. M = {1, 2, 3, …, 1000} OR M= {1000, 999, 998,…, 1}. Order is not important.
 1xϵ M means x is a member of M.
Set Builder method:
 Another way of representing a set is by writing down the property that is common to its elements (and to
no others).
 B = {1,2,3,6} could be described as B={x: x is a factor of 6}.
 This manner of describing a set according to a common property or rule is called Set-builder (or Rule
method)
Important sets : N, Z,Q, R, C
 N = {1,2,3,4,..}
 Z = {…….-2,-1,0,1,2,3,….}
 Q = { x: x=p/q , q≠ 0, p , q ϵ Z}
 R = set of all real numbers
Prof.A Choudhury 4 04/19/2023
Subsets
 A set A is called a subset of a set B if every element of A is an element of B. This situation is represented
by the notation AB.
 If A is not a subset of B, we write A B. If there is even one element in A that is not in B, then A B.
 Every set A is a subset of itself.
 The empty set is a subset of every set A. A and are called the Trivial subsets of A. Do the other subsets
also belong to a set?
Cardinality of a set:
The size of a set is given by the number of elements of a finite non-empty (discrete) set , known as the
cardinality of the set.
For example,
 has 0 element
 {1} has 1 element
 {1, 2} has 2 elements
Equivalent sets:
If two sets have the same cardinality, they are said to be equivalent. It is obvious that if two sets are equal
then they will have the same cardinality. On the other hand, two equivalent sets need not be equal.

Prof.A Choudhury 5 04/19/2023


Subsets of R
Intervals : The subsets of R are called intervals.
The closed interval ,[a, b] = {x: a≤ x ≤b, xϵR} is a subset of R
The semi- closed or semi-open interval, (a , b] = {x: a< x ≤ b , xϵR} is a
subset of R.
Similarly, [ a, b) and (a , b)(open interval) are subsets.

Prof.A Choudhury 6 04/19/2023


Power set

Definition: The set whose elements are all the subsets of a set X is called the
power set of X. We shall represent it by P(X)(or 2|X|).
Example:
1)X=
2)X={
3) X= {a,{b},{c}} ,P(X)=______
 If X has k elements, then the number of subsets is 2k . Therefore, |P (X)| =
2k
 If X has k elements, then the number of proper subsets is 2k-1 .

If X has 4 elements then how many subsets of X are 3 element subsets?

Prof.A Choudhury 7 04/19/2023


Power sets

Prof.A Choudhury 8 04/19/2023


Set operations-Union
The union of two sets A and B is the collection of all elements that are either in A
or in B. The union of A and B is denoted by A B.
 A B = {x | x ϵ A or x ϵ B}
 When we say `all elements that are either in A or in B' we are using or in its
inclusive sense: We are also including those elements which are in both A and B.
Example:
U= {1,2,3,4,5}, A={2,3},B={1,3} , C={ 4,5}
 A, B and C are subsets of U.
 AB= {1,2,3}
 BC= {1,3,4,5}
 AC= {2,3,4,5}
 ABC={1,2,3,4,5}
 AU=U

Prof.A Choudhury 9 04/19/2023


Set operations-Intersection
The intersection of two sets A and B is the collection of all
elements that are in both sets. It is denoted by A B:
A B = {x | x ϵ A and x ϵ B}
Example:
A= {2,3,4} ; B={3,4,5}; U= {1,2,3,4,5}
A B= {3,4}
A U= A; B U=B

Prof.A Choudhury 10 04/19/2023


Complement of a set
Let U be a set and A any subset of U. Then the complement of the set A in U is the
collection of all the elements of U that are not in A. The complement of A is usually
denoted by A’ or Ac or
A’ = {x ϵ U | x A}
Example:
U= {1,2,3,4,5}, A={2,3} ,A’={1,4,5}

Prof.A Choudhury 11 04/19/2023


Difference of sets

Let X and Y be two sets.


1) The set difference of X and Y , denoted by X \ Y , is defined by X \ Y = {x
X : x Y }.
2) The set (X \ Y )(Y \ X), denoted by XY , is called the symmetric
difference of X and Y .
Example:
a)X={1,2,4,18};Y={x
X\Y= {18} ;Y\X={3,5};X
b) S={x;define S\T and T\S.
c) X={{b , c},{b},{c},b};Y={a , b, c}; define X\Y,Y\X,XY

Prof.A Choudhury 12 04/19/2023


Interrelated properties

Prof.A Choudhury 13 04/19/2023


Cartesian Product of sets

Let X and Y be two sets. Then their Cartesian product, denoted by X Y ,


is defined as X Y = {(a; b) : a X; b Y }. The elements of X Y are also called
ordered pairs with the elements of X as the first entry and elements of
Y as the second entry.

Example:
1)X={1,2,3} , Y={a, b}
X
2) Euclidean plane R2= R R= {(x, y): x , yR}
3) X Y = if and only if X= or Y=.

Prof.A Choudhury 14 04/19/2023


Inclusion-exclusion principle
Theorem: If A and B are non-empty finite sets , then
|AꓴB|= |A| +|B| -|A∩B|.
Example:
1)The Masters of the Universe Society at a certain college accepts members who
have 2400 SAT scores or 4.0 GPAs in high school. Of the 11 members of the
society, 8 had 2400 SAT scores, and 5 had 4.0 GPAs. How many members had
both 2400 SAT scores and 4.0 GPAs?
2)On a certain day, a restaurant served 25 people breakfast and later served 37
people lunch. How many different customers did they have in total?
Theorem: Suppose A1,A2,A3,….An are pairwise disjoint finite sets that is, Ai ∩A
j=φ. Then

| A1+A2+A3+….+An |= | A1|+A2|+A3|+….+|An |.

Prof.A Choudhury 15 04/19/2023


Counting-bijection rule
 Every counting problem comes down to finding the size of some set.
 Size of a set- cardinality of set S=|S|
 How do you count the number of people in a room?
 If there exists a bijection f : A → B, then |A| = |B|.
 When we want to determine the size of some other set B, we’ll find a bijection from B to a set
of sequences A.
Two basic rules of counting:
Sum rule : If A1,A2, . . . ,An are disjoint sets, then:
|A1 A2 . . . An| = |A1| + |A2| + . . . + |An|
Product rule :If P1, P2, . . . Pn are sets, then:
|P1 × P2 × . . . × Pn| = |P1| · |P2| · · · |Pn|
Example:
Let a valid password on a certain computer system be a sequence of six to eight symbols. The
first symbol must be a letter (which can be lowercase or uppercase), and the remaining symbols
must be either letters or digits. How many different passwords are possible?

Prof.A Choudhury 16 04/19/2023


Arrangement principle
Arrangement Principle. The number of ways to form an ordered list of r distinct elements drawn
from a set of n elements is

Properties :
 The order of the elements matter.
 All the elements are distinct.
The notation comes from the mathematical term for arrangements:

.
Example:
1)A baseball team has a 24-man roster. How many different ways are there to choose a 9-man
batting order?
2) An urn contains 10 ping-pong balls, numbered 1 through 10. Four balls are drawn from the urn
in sequence, and the numbers on the balls are recorded. How many ways are there to do this, if
(a) the balls are replaced before the next one is drawn.
(b) the balls are drawn and not replaced?

Prof.A Choudhury 17 04/19/2023


Selection principle
Selection Principle. The number of ways to choose a subset of r elements from a
set of n elements is

 In the selection principle, the r! factor in the denominator accounts for the fact
that no order is imposed on the elements of the subset.
 Arrangements and selections both involve choosing a subset of some set.
 In arrangements, the order of the elements in the subset matters; in selections, it
doesn’t.
Example:
1)A baseball team has a 24-man roster. How many different ways are there to
choose a group of nine players to start the game?
2) Suppose an urn contains 10 ping-pong balls numbered 1 through 10. Instead of
drawing four balls in sequence, reach in and grab a handful of four balls.
How many different handfuls can you grab?
Prof.A Choudhury 18 04/19/2023
Discrete Probability
How many elements of set U are in some subset A?
What percentage of elements of U are in the subset A?
Discrete Probability: Suppose A is a subset of a nonempty finite set U. The probability that a
randomly chosen element of U lies in A is the ratio

a) 0 ; b)
Example:
1)Suppose you get a random license plate from all the possible plates consisting of three
alphabets followed by three digits. What is the probability that your plate contains the word CUB
or the word SOX?
2) Suppose that there are 10 defective machines in a group of 200. A quality
control inspector takes a sample of three machines and tests them for defects. How likely is it
that the inspector discovers at least one defective machine?
3) An urn contains seven red balls, seven white balls, and seven blue balls. A sample of five balls is
drawn at random without replacement. What is the probability that the sample contains three
balls of one color and two of another?

Prof.A Choudhury 19 04/19/2023


Prof.A Choudhury 20 04/19/2023
Prof.A Choudhury 21 04/19/2023
Random variable
Random variable: A random variable X on a probability space is a function whose
domain is the sample space.
Discrete random variable: A random variable that can take on only a finite or
countably infinite set of outcomes.
Example: Suppose an unbiased coin is tossed
thrice.U={HHH,HHT,HTH,HTT,THH,THT,TTH,TTT}
Define a random variable X as the ‘number of heads that appear’.
X(HHH)=3, X(HHT)=2, X(HTH)=2, X(THH)=2, X(TTH)=1, X(THT)=1,
X(HTT)=1, X(TTT)=0 .Therefore, X=0,1,2,3
The probability distribution of the random variable X is as follows.
Find:
i) P(X≤1)
ii) P(X>1)
iii) P(X<2).

Prof.A Choudhury 22 04/19/2023


Expected value
Suppose that we repeat a random experiment several times and record the value of a
random variable each time. If we averaged these results, we would get an estimate of the
probabilistic “average” of the random variable.
Definition: Let x1,x2,…x n be all the possible values of a random variable X. Then the
expected value of X is denoted by E(X) and defined as E(X)=
Example: The expected value of the ‘number of heads’ when a coin is tossed thrice .
E(X)= ++
Example
1)If you roll a four-sided die and a six-sided die, which roll totals (2,3, …, 10) have the
highest probability? Find the expected value of the roll total when rolling a four-sided die
and a six-sided die.
2) An urn contains 4 red balls and 6 green balls. Three balls are chosen randomly from the
urn, without replacement.
(a) What is the probability that all three balls are red?
(b) Suppose that you win $10 for each red ball drawn and you lose $5 for each green ball
drawn. Compute the expected value of your winnings.

Prof.A Choudhury 23 04/19/2023


Thank you
Thank you

Prof.A Choudhury 24 04/19/2023

You might also like