Week 2 Slides
Week 2 Slides
∩i∈I Ai = ∅
• A collection of sets is pairwise disjoint (or mutually disjoint) if every pair of
sets in the collection are disjoint
Set Operations
Definitions:
• The union of sets A and B is the set A ∪ B = { x | (x ∈ A) ∨ (x ∈ B) }. More
generally, the union of a family of sets is the set of objects that are members
of at least one set in the family. The notation
∪i∈I Ai = { x | x ∈ Ai for some i ∈ I }
is used for the union of the family of sets Ai indexed by the set I
• A partition of a set S is a pairwise disjoint family P = {Ai} of nonempty subsets
whose union is S
Set Operations (cont.)
Definitions:
• The complement of the set A is the set A = U − A = { x | x A}
containing every object not in A, where the context provides that
the objects range over some specific universal domain U. (The
notation A or Ac is sometimes used instead of A)
• The set difference is the set A − B = { x | (x ∈ A) ∧ (x B) }. The set
difference is sometimes written A \ B
• The symmetric difference of A and B is the set A ⊕ B = { x | (x ∈ A
− B) ∨ (x ∈ B − A) }. This is sometimes written A ∆ B
Set Operations (cont.)
Definitions:
• The Cartesian product A×B of two sets A and B is the set { (a, b) |
(a ∈ A) ∧ (b ∈ B) }, which contains all ordered pairs whose first
coordinate is from A and whose second coordinate is from B
• The power set of A is the set P(A) of all subsets of A. The
alternative notation 2A for P(A) emphasizes the fact that the power
set has 2n elements if A has n elements
• A Venn diagram is a family of n simple closed curves (typically
circles or ellipses) arranged in the plane so that all possible
intersections of the interiors are nonempty and connected
Venn Diagram
A B
Venn Diagram
Set Operations (cont.)
Random experiment and Sample Space
Definitions:
• An experiment that can result in different outcomes, even though
it is repeated in the same manner every time, is called a Random
Experiment.
• Tossing a coin or Rolling a dice are random experiments that we
know every possible outcome but do not know the result of the
experiment, whether Head or Tail, or number on the dice
• For any experiment the Sample Space is the set of all possible
outcomes of the experiment (usually denoted by S)
Random experiment and Sample Space
Examples:
• If we toss a coin once we know that it will be Head (H) or Tail(T). There is
no other alternative, ie all possible outcomes. Our sample space S will
be S={H, T}
• Similarly rolling a dice will result a number in 1-6, there is no other
alternative. So the set of all possible outcomes in Rolling a dice is
S={1,2,3,4,5,6}.
• Think about tossing two coins, what would be our S in that case?
• Similarly roll two dice at the same time, what would be S?
• If there are more than one event (simultaneous occurance) it is
practical to list all possible outcomes with a Tree Diagram
Sample Space – Tree Diagrams
Example:
• Tossing two coins, what would be our S in that case?
T H (T,H)
T (T,T)
Sample Space – Tree Diagrams
Example:
• Roll two dice at the same time, what would be S?
Dice 1
1 2 3 4 5 6
• A∩B=∅
Events
Probability of an event
Example:
The following table summarizes visits to emergency departments at four hospitals in
Arizona. People may leave without being seen by a physician, and those visits are
denoted as LWBS. The remaining visits are serviced at the emergency department,
and the visitor may or may not be admitted for a stay in the hospital. Let A denote the
event that a visit is to Hospital 1 and let B denote the event that the result of the visit is
LWBS. Calculate the number of outcomes in A ∩ B , A’, and A ∪ B.
Hospital 1 2 3 4 Total
Total 5292 6991 5640 4329 22,252
LWBS 195 270 246 242 953
Admitted 1277 1558 666 984 4485
Not admitted 3820 5163 4728 3103 16,814 10 mins
Probability of an event
Solution:
• The event A ∩ B consists of the 195 visits to Hospital 1 that result in
LWBS.
• The event A’ consists of the visits to Hospitals 2, 3, and 4 and contains
6991 + 5640 + 4329 = 16,690 visits.
• The event A ∪ B consists of the visits to Hospital 1 or the visits that
result in LWBS, or both, and contains 5292 + 270 + 246 + 242 = 6050
visits.
• Notice that the last result can also be calculated as the number of
visits in A plus the number of visits in B minus the number of visits in A
∩ B (that would otherwise be counted twice) 5292 + 953 - 195 = 6050
Finding sample space S
• In many of the previous examples, it is easy to determine the
number of outcomes in each event.
• In more complicated examples, determining the outcomes that
comprise the sample space (or an event) becomes more difficult.
• Instead, the counts of the numbers of outcomes in the sample
space and various events are used to analyze the random
experiments.
• These methods are referred to as counting techniques. Some
simple rules can be used to simplify the calculations. Let’s see
them;
Counting
• Remember the example of tossing a coin and Rolling a dice. What
is the number of elements in S. It was 2x6 = 12.
• Or Rolling two dices, n(S) = 6x6 = 36
• Both were independent events, meaning the occurence of one
does not effect the occurence of other
• This leads to a definition that ease the calculation of number of
possible outcomes for independent events
• If two events are independent from each other the combination of
these two is just simply multiplication of individual possibilities
• Or more formally;
Counting: Multiplication Rule
Definition:
• Assume an operation can be described as a sequence of k steps,
and the number of ways of completing step 1 is n1, and the
number of ways of completing step 2 is n2 for each way of
completing step 1, and the number of ways of completing step 3 is
n3 for each way of completing step 2, and so forth.
• The total number of ways of completing the operation is
n1 x n2 x ………….. x nk
Counting: Multiplication Rule
Example:
• Remember the car manifacturer example that we draw a tree
diagram to list all possible outcomes. There were
• With or without an automatic transmission (2 alternatives)
• With or without air conditioning (2 alternatives)
• With one of three choices of a stereo system (3 alternatives)
• With one of four exterior colors (4 alternatives)
Since all these properties are independent of each other we can
simply calculate the number of all possible alternatives without
listing them explicitly, n(S) = 2 x 2 x 3 x 4 = 48
Counting: Permutations
• Another useful calculation is the number of ordered sequences of
the elements of a set. Consider a set of elements, such as S {a, b,
c}.
• A permutation of the elements is an ordered sequence of the
elements. For example, abc, acb, bac, bca, cab, and cba are all of
the permutations of the elements of S.
• This leads to a more formal definition of permutations
Counting: Permutations
Definition:
• The number of permutations of n different elements is n! where
𝑛!
𝑃𝑟 = n x (n-1) x (n-2) x ….. x (n-r+1) =
𝑛
𝑛−𝑟 !
• Think about the previous problem this time form 2 digit numbers from 4
digits?
Counting: Permutations of Subsets
Example:
• A printed circuit board has eight different locations in which a
component can be placed. If four different components are to be
placed on the board, how many different designs are possible?
• Each design consists of selecting a location from the eight locations for
the first component, a location from the remaining seven for the
second component, a location from the remaining six for the third
component, and a location from the remaining five for the fourth
component. Therefore,
8 8!
𝑃4 = 8 x 7 x 6 x 5 = = 1680 𝑑𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑡 𝑑𝑒𝑠𝑖𝑔𝑛 𝑝𝑜𝑠𝑠𝑖𝑏𝑙𝑒
8−4 !
Counting: Permutations of similar objects
• Sometimes we are interested in counting the number of ordered
sequences for objects that are not all different. The following
result is a useful, general calculation.
𝑛!
𝑛1!𝑛2!𝑛3!𝑛4!..𝑛𝑟!
Counting: Permutations of similar objects
Example:
• A part is labeled by printing with four thick lines, three medium
lines, and two thin lines. If each ordering of the nine lines
represents a different label, how many different labels can be
generated by using this scheme?
9!
By the above definition it is = 1260 different labels
4!3!2!
Counting: Permutations of similar objects
Example:
• Consider a machining operation in which a piece of sheet metal
needs two identical-diameter holes drilled and two identical-size
notches cut. We denote a drilling operation as d and a notching
operation as n. In determining a schedule for a machine shop, we
might be interested in the number of different possible sequences
of the four operations. The number of possible sequences for two
drilling operations and two notching operations is
4!
=6
2!2!
We can list them as ddnn, dndn, dnnd, nddn, ndnd, nndd.
Counting: Combinations w-3
• Another counting problem of interest is the number of subsets of r
elements that can be selected from a set of n elements. Here,
order is not important. These are called combinations.
• Combinations: The number of combinations, subsets of size r
𝑛
that can be selected from a set of n elements, is denoted ( )as or
𝑟
𝐶𝑟 and
𝑛
𝑛
𝐶𝑟𝑛 = ( ) =
𝑛!
𝑟 𝑟! 𝑛−𝑟 !
Counting: Combinations
Example:
• A bin of 50 manufactured parts contains three defective parts and
47 nondefective parts. A sample of six parts is selected from the
50 parts without replacement. That is, each part can only be
selected once and the sample is a subset of the 50 parts. How
many different samples are there of size six that contain exactly
two defective parts?
Counting: Combinations
Solution:
• A subset containing exactly two defective parts can be formed by first
choosing the two defective parts from the three defective parts.
That is 𝐶23 = 3 different ways
• Then, the second step is to select the remaining four parts from the 47
acceptable parts in the bin. The second step can be completed in
𝐶447 = 178,365 different ways
• Therefore, from the multiplication rule, the number of subsets of size six that
contain exactly two defective items is 3 x 178,365 = 535,095
Counting: Combinations
Example:
• One more question, what is the probability that a sample contains
exactly two defective parts?
• We calculated the number of events that have exactly 2 defective parts that is
535,095.
• What was the probability? It was the ratio of events divided by sample space
• What is the size of the sample space in that case?
• It is just selecting 6 out of 50 that is 𝐶650 = 15,890,700
• So the probability that a selected sample will have exactly two defective parts
P(E)= n(E)/n(S) = 535,095 / 15,890,700 = 0.034
Assignment HW1
• Do excercise 2.16, 2.21, 2.34 and 2.46 of Chapter 2.1 in the Textbook
• Due Next Sunday at 23:00
• Send me via TEAMS (I will enter this as assignment, follow the assignments tab)
• Filename should be standart in the following format
HW#sStudent Id.doc
Red parts:
# represents the assignment number (1 for week one, 2 week two, etc)
Student Id is your THK Student id number (10 digits starting with the letter «s»; «s»+9 digits)
Example for week one the sample file name for student id: 123456789 would be
HW1s123456789.doc