logic and introduction to sets chapter 6 dr.hayk melikyan/ department of mathematics and cs/...

17
Logic and Introduction to Logic and Introduction to Sets Sets Chapter 6 Chapter 6 Dr .Hayk Melikyan/ Department of Mathematics and CS/ Dr .Hayk Melikyan/ Department of Mathematics and CS/ [email protected] [email protected] 6.3 Basic Counting Basic Counting Principles Principles . In this section, we will see how In this section, we will see how set operations play an important set operations play an important role in counting techniques. role in counting techniques.

Upload: andra-fox

Post on 02-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Logic and Introduction to SetsLogic and Introduction to SetsChapter 6Chapter 6

Dr .Hayk Melikyan/ Department of Mathematics and CS/ Dr .Hayk Melikyan/ Department of Mathematics and CS/ [email protected]@nccu.edu

6.3 Basic Counting PrinciplesBasic Counting Principles

. In this section, we will see how set In this section, we will see how set

operations play an important role in operations play an important role in counting techniques. counting techniques.

Page 2: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

SetsSets. Operations with sets and their properties. Operations with sets and their properties..

( union, intersection and complement )( union, intersection and complement )  1.1. Let Let AA be a set with finitely many elements. be a set with finitely many elements.

Then Then nn((AA) denotes the number of elements in ) denotes the number of elements in AA..

22. . ADDITION PRINCIPLEADDITION PRINCIPLE (for counting) (for counting) For any two sets For any two sets AA and and BB,,

nn((AA BB) = ) = nn((AA) + ) + nn((BB) - ) - nn((AA BB)) If If AA and and BB are disjoint, i.e., if are disjoint, i.e., if AA BB = = , then , then

nn((AA BB) = ) = nn((AA) + ) + nn((BB))

Page 3: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Opening example Opening example To see how sets play a role in counting, consider the following To see how sets play a role in counting, consider the following

example. example.

In a certain class, there are 23 majors in Psychology, 16 In a certain class, there are 23 majors in Psychology, 16 majors in English and 7 students who are majoring in majors in English and 7 students who are majoring in both Psychology and English. If there are 50 students in both Psychology and English. If there are 50 students in the class, how many students are majoring in neither of the class, how many students are majoring in neither of these subjects?these subjects?

B) How many students are majoring in Psychology B) How many students are majoring in Psychology

alone? alone?

Page 4: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Solution: Solution:

We introduce the following principle of We introduce the following principle of counting that can be illustrated using a counting that can be illustrated using a Venn-Diagram. Venn-Diagram.

N( A U B) = n(A) + n(B) – n(A B) N( A U B) = n(A) + n(B) – n(A B)

This statement says that the number of This statement says that the number of elements in the union of two sets A and elements in the union of two sets A and B is the number of elements of A added B is the number of elements of A added to the number of elements of B minus to the number of elements of B minus the number of elements that are in both the number of elements that are in both A and B. A and B.

A B

Page 5: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Venn DiagramsVenn Diagrams

Venn diagramsVenn diagrams are are usefuluseful

tools for determining tools for determining thethe

number of elements in number of elements in thethe

various sets in survay. various sets in survay.

Often the results areOften the results are

represented as a tablerepresented as a table

Page 6: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Do you see how the numbers of each region are obtained from the given Do you see how the numbers of each region are obtained from the given information in the problem? We start with the region represented by the information in the problem? We start with the region represented by the intersection of Psych. And English majors (7). Then, because there must be 23 intersection of Psych. And English majors (7). Then, because there must be 23 Psych. Majors, there must be 16 Psych majors remaining in the rest of the set. Psych. Majors, there must be 16 Psych majors remaining in the rest of the set. A similar argument will convince you that there are 9 students who are A similar argument will convince you that there are 9 students who are majoring in English alone. majoring in English alone.

English majorsPsychology majors

Both Psych and English

7 students in this region

16 students here

9 students in this region

N(P U E) =

n(P)+n(E)-n(P E)

23 + 16 – 7 = 32

Page 7: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

A second problem A second problem

A survey of 100 college faculty who exercise regularly A survey of 100 college faculty who exercise regularly found that 45 jog, 30 swim, 20 cycle, 6 jog and swim, found that 45 jog, 30 swim, 20 cycle, 6 jog and swim, 1 jogs and cycles, 5 swim and cycle, and 1 does all 1 jogs and cycles, 5 swim and cycle, and 1 does all three. How many of the faculty members do not do three. How many of the faculty members do not do any of these three activities? How many just jog? any of these three activities? How many just jog?

We will solve this problem using a three-circle Venn We will solve this problem using a three-circle Venn Diagram in the accompanying slides. Diagram in the accompanying slides.

Page 8: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

We will start with the intersection of all three We will start with the intersection of all three circles. This region represents the number of faculty circles. This region represents the number of faculty who do all three activities (one). Then, we will who do all three activities (one). Then, we will proceed to determine the number of elements in proceed to determine the number of elements in each intersection of exactly two setseach intersection of exactly two sets

J =joggers

C=Cyclists S=swimmers

1 does all 3

Page 9: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Solution: Solution: Starting with the intersection of Starting with the intersection of

all three circles, we place a 1 in all three circles, we place a 1 in that region (1 does all three). that region (1 does all three). Then we know that since 6 jog Then we know that since 6 jog and swim so 5 faculty remain in and swim so 5 faculty remain in the region representing those the region representing those who just jog and swim. Five who just jog and swim. Five swim and cycle, so 4 faculty just swim and cycle, so 4 faculty just swim and cycle but do not do all swim and cycle but do not do all three. Since 1 faculty is in the three. Since 1 faculty is in the intersection region of joggers intersection region of joggers and cyclists, and we already and cyclists, and we already have one that does all three have one that does all three activities, there must be no activities, there must be no faculty who faculty who just just jog and cycle. jog and cycle.

Page 10: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Multiplication principleMultiplication principle The tree diagram illustrates the 24 ways to The tree diagram illustrates the 24 ways to

get dressed.get dressed.

To illustrate this principle, let’s start with anTo illustrate this principle, let’s start with anexample. Suppose you have 4 pairs of trousersexample. Suppose you have 4 pairs of trousersin your closet, 3 different shirts and 2 pairs ofin your closet, 3 different shirts and 2 pairs ofshoes. Assuming that you must wear trousersshoes. Assuming that you must wear trousers(we hope so!), a shirt and shoes, how many(we hope so!), a shirt and shoes, how manydifferent ways can you get dressed? Let’sdifferent ways can you get dressed? Let’sassume the colors of your pants are black, grey,assume the colors of your pants are black, grey,rust, olive. You have four choices here. The shirtrust, olive. You have four choices here. The shirt]colors are green, marine blue and dark blue.]colors are green, marine blue and dark blue.For each pair of pants chosen (4) you have (3)For each pair of pants chosen (4) you have (3)options for shirts. You have 12 = 4*3 optionsoptions for shirts. You have 12 = 4*3 optionsfor wearing a pair of trousers and a shirt. Now,for wearing a pair of trousers and a shirt. Now,each of these twelve options, you have two paireach of these twelve options, you have two pairof shoes to choose from (Black or brown). Thus,of shoes to choose from (Black or brown). Thus,you have a total of you have a total of

4*3*2 = 24 options to get dressed.4*3*2 = 24 options to get dressed.

Page 11: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

MULTIPLICATION PRINCIPLEMULTIPLICATION PRINCIPLE(a)(a) If two operations If two operations OO11 and and OO22 are performed in order, are performed in order,

with with NN11 possible outcomes for the first operation and possible outcomes for the first operation and NN2 2

possible outcomes for the second operation, then possible outcomes for the second operation, then there are there are NN11··NN2 2 possible combined outcomes of the possible combined outcomes of the first operation followed by the second.first operation followed by the second.

  

(b) In general, if (b) In general, if nn operations operations OO11, , OO22, ..., , ..., OOnn are performed are performed in order with possible number of outcomesin order with possible number of outcomes

NN11, , NN22, ..., , ..., NNnn, respectively, then there are, respectively, then there are

NN11··NN22·...··...·NNnnpossible combined outcomes of the operations performed possible combined outcomes of the operations performed

in the given order.in the given order.

Page 12: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

More problems… More problems…

How many different ways can a team consisting of 28 players How many different ways can a team consisting of 28 players select a captain and an assistant captain? select a captain and an assistant captain?

Solution: Operation 1: select the captain. If all team members Solution: Operation 1: select the captain. If all team members are eligible to be a captain, there are 28 ways this can be done. are eligible to be a captain, there are 28 ways this can be done.

Operation 2. Select the assistant captain. Assuming that a Operation 2. Select the assistant captain. Assuming that a player cannot be player cannot be both both a captain and assistant captain, there a captain and assistant captain, there are 27 ways this can be done, since there are 27 team are 27 ways this can be done, since there are 27 team members left who are eligible to be the assistant captain. members left who are eligible to be the assistant captain.

Then, using the multiplication principle there are (28)(27) ways Then, using the multiplication principle there are (28)(27) ways to select both a captain and an assistant captain. This number to select both a captain and an assistant captain. This number turns out to be 756.turns out to be 756.

Page 13: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Next exampleNext example A sportswriter is asked to rank 8 teams in the NBA A sportswriter is asked to rank 8 teams in the NBA

from first to last. How many rankings are possible? from first to last. How many rankings are possible?

Solution: We will use 8 slots that need to be filled. In the first slot, we Solution: We will use 8 slots that need to be filled. In the first slot, we will determine how many ways to choose the first place team, the will determine how many ways to choose the first place team, the second slot is the number of ways to choose the second place team second slot is the number of ways to choose the second place team and so on until we get to the 8and so on until we get to the 8thth place team. There are 8 choices that place team. There are 8 choices that can be made for the first place team since all teams are eligible. That can be made for the first place team since all teams are eligible. That leaves 7 choices for the second place team. The third place team is leaves 7 choices for the second place team. The third place team is determined from the 6 remaining choices and so on. determined from the 6 remaining choices and so on.

Total is the product of 8(7)…1 = Total is the product of 8(7)…1 = 4032040320

8 7 6 5 4 3 2 1

Page 14: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Examples ( Code Words)Examples ( Code Words)

How many three letter code words are How many three letter code words are possible using first 8 letters of the possible using first 8 letters of the alphabetalphabet

a)a)          No letters can be repeated?No letters can be repeated?

b)b)          Letters can be repeated?Letters can be repeated?

c)c)          Adjacent letters cannot be same.Adjacent letters cannot be same.

Page 15: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Tree DiagramTree DiagramProblem #15.Problem #15. A coin is tossed with possible A coin is tossed with possible

outcomes head H, or tails, T. Then a single die is outcomes head H, or tails, T. Then a single die is tossed with possible outcomes 1, 2, 3, 4, 5, or 6. tossed with possible outcomes 1, 2, 3, 4, 5, or 6. How many combined outcomes are there?.How many combined outcomes are there?.

B) Multiplication Principle

O1: Coin N1: 2 outcomesO2: Die N2: 6 outcomes

Thus, there are N1·N2 = 2·6 = 12 combined outcomes

Page 16: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Tree Diagram for (15)Tree Diagram for (15)

Thus, there are 12 combined outcomes.Thus, there are 12 combined outcomes. Combined

outcomes

H

T

Coin

Start

(H, 1)

(H, 2)

(H, 3)

(H, 4)

(H, 5)

(H, 6)

12

3

4

56

12

3

4

56

Die

(T, 1)

(T, 2)

(T, 3)

(T, 4)

(T, 5)

(T, 6)

Page 17: Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ melikyan@nccu.edu Basic Counting Principles 6.3 Basic Counting

Problem #45Problem #45. . Let Let TT = the people who play tennis, and = the people who play tennis, and GG = the people who play golf. = the people who play golf. Then Then nn((TT) = 32, ) = 32, nn((GG) = 37, ) = 37, nn((TT GG) = 8 and ) = 8 and nn((UU) = 75. Thus, ) = 75. Thus,

nn((TT GG) = ) = nn((TT) + ) + nn((GG) - ) - nn((TT   GG) =) = = 32 + 37 - 8 = 61= 32 + 37 - 8 = 61 The set of people who play neither tennis norThe set of people who play neither tennis nor golf is represented by golf is represented by T T ' '   G G '. '. Since Since UU = ( = (TT   GG) )  ( (T T ' ' G G ') and ') and ((TT GG) ) ( (T T ' '   G G ')=')=,, it follows that it follows that nn((T T ' '   G G ') =') =nn((UU)-)-nn((TT GG) ) = 75 - 61 = 14.= 75 - 61 = 14.

There are 14 people who play neither tennis There are 14 people who play neither tennis nor golf. nor golf.