6.1 logic - governors state university understand the logic behind the truth table for the...

48
6.1 Logic 6.1 Logic Logic is not only the foundation of mathematics, but also is Logic is not only the foundation of mathematics, but also is important in numerous fields including law, medicine, important in numerous fields including law, medicine, and science. Although the study of logic originated in and science. Although the study of logic originated in antiquity, it was rebuilt and formalized in the 19 antiquity, it was rebuilt and formalized in the 19 th th and and early 20 early 20 th th century. George century. George Boole Boole (Boolean algebra) (Boolean algebra) introduced mathematical methods to logic in 1847 while introduced mathematical methods to logic in 1847 while Georg Georg Cantor did theoretical work on sets and Cantor did theoretical work on sets and discovered that there are many different sizes of infinite discovered that there are many different sizes of infinite sets. sets.

Upload: phamkien

Post on 12-May-2018

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

6.1 Logic 6.1 Logic

Logic is not only the foundation of mathematics, but also is Logic is not only the foundation of mathematics, but also is important in numerous fields including law, medicine, important in numerous fields including law, medicine, and science. Although the study of logic originated in and science. Although the study of logic originated in antiquity, it was rebuilt and formalized in the 19antiquity, it was rebuilt and formalized in the 19thth and and early 20early 20thth century. George century. George BooleBoole (Boolean algebra) (Boolean algebra) introduced mathematical methods to logic in 1847 while introduced mathematical methods to logic in 1847 while GeorgGeorg Cantor did theoretical work on sets and Cantor did theoretical work on sets and discovered that there are many different sizes of infinite discovered that there are many different sizes of infinite sets. sets.

Page 2: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Statements or PropositionsStatements or Propositions

A proposition or statement is a declaration which is either trueA proposition or statement is a declaration which is either true or false. or false. Some examples: Some examples:

2+2 = 5 2+2 = 5 is a statement because it is a false declaration. is a statement because it is a false declaration. Orange juice contains vitamin C Orange juice contains vitamin C is a statement that is is a statement that is true. true. Open the door. Open the door. This is not considered a statement since This is not considered a statement since we cannot assign a true or false value to this sentence. we cannot assign a true or false value to this sentence. It is a command, but not a statement or proposition. It is a command, but not a statement or proposition.

Page 3: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Negation Negation

The negation of a statement, p , is The negation of a statement, p , is ““not pnot p””and is denoted by and is denoted by ┐┐ ppTruth table: Truth table: p p ┐┐ p p

TT FFFF TTIf p is true, then its negation is false. If p is false, then itIf p is true, then its negation is false. If p is false, then its negation is true.s negation is true.

Page 4: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

DisjunctionDisjunction

A disjunction is of the form p V q and is read A disjunction is of the form p V q and is read p or q.p or q.Truth table for disjunction: Truth table for disjunction: pp qq p V q p V q

TT TT TTTT FF TTFF TT TTFF FF FF

A disjunction is true in all cases except when A disjunction is true in all cases except when both p and q are false.both p and q are false.

Page 5: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Conjunction Conjunction

A conjunction is A conjunction is only trueonly true when both p and q are true. Otherwise, a when both p and q are true. Otherwise, a conjunction of two statements will be false: conjunction of two statements will be false:

Truth table: Truth table:

pp qq p qp q

TT TT TTTT FF FFFF TT F F FF FF FF

Page 6: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Conditional statementConditional statement

To understand the logic behind the truth table for the conditionTo understand the logic behind the truth table for the conditional statement, consider al statement, consider the following statement. the following statement.

““If you get an A in the class, I will give you five bucks.If you get an A in the class, I will give you five bucks.””Let p = statement Let p = statement ““ You get an A in the classYou get an A in the class””Let q = statement Let q = statement ““ I will give you five bucksI will give you five bucks..””Now, if p is true (you got an A) and I give you the five bucks, Now, if p is true (you got an A) and I give you the five bucks, the truth value of the truth value of p qp q is true. The contract was satisfied and both parties fulfilled is true. The contract was satisfied and both parties fulfilled the agreement. the agreement. Now, suppose p is true (you got the A) and q is false (you did nNow, suppose p is true (you got the A) and q is false (you did not get the five bucks). ot get the five bucks). You fulfilled your part of the bargain, but werenYou fulfilled your part of the bargain, but weren’’t rewarded with the five bucks.t rewarded with the five bucks.So So p qp q is false since the contract was broken by the other party. is false since the contract was broken by the other party. Now, suppose p is false. You did not get an A but received five Now, suppose p is false. You did not get an A but received five bucks anyway. (q is bucks anyway. (q is true) No contract was broken. There was no obligation to receivtrue) No contract was broken. There was no obligation to receive 5 bucks, so truth e 5 bucks, so truth value of value of p qp q cannot be false, so it must be true. cannot be false, so it must be true. Finally, if both p and q are false, the contract was not broken.Finally, if both p and q are false, the contract was not broken. You did not receive the You did not receive the A and you did not receive the 5 bucks. So A and you did not receive the 5 bucks. So p qp q is true in this case. is true in this case.

Page 7: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Truth table for conditionalTruth table for conditional

pp qq p qp qTT TT TTTT FF FFFF TT TTFF FF TT

Page 8: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Variations of the conditionalVariations of the conditional

Converse: Converse: The converse of p q is The converse of p q is q pq p

ContrapositiveContrapositive: : The The contrapositivecontrapositive of p q is of p q is ┐┐q q ┐┐pp

Page 9: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

ExamplesExamples

Let p = you receive 90% Let p = you receive 90% Let q = you receive an A in the course Let q = you receive an A in the course p q ? p q ?

If If you receive 90%,you receive 90%, then then you will receive an A in the courseyou will receive an A in the course..Converse: q p Converse: q p

If you If you receive an A in the coursereceive an A in the course, then , then you receive 90%you receive 90%Is the statement true? No. What about the student who receives aIs the statement true? No. What about the student who receives ascore greater than 90? That student receives an A but did not score greater than 90? That student receives an A but did not achieve a score of achieve a score of exactly 90%. exactly 90%.

Page 10: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Example 2Example 2

State the State the contrapositivecontrapositive in an English sentence: in an English sentence: Let p = you receive 90% Let p = you receive 90% Let q = you receive an A in the course Let q = you receive an A in the course p q ? p q ? If If you receive 90%,you receive 90%, then then you will receive an A in the courseyou will receive an A in the course

┐┐q q ┐┐ppIf you If you dondon’’t receive an A in the courset receive an A in the course, then you , then you didndidn’’t receive 90%.t receive 90%.The The contrapositivecontrapositive is true not only for these particular statements is true not only for these particular statements but for all statements , p and q. but for all statements , p and q.

Page 11: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Logical equivalent statements Logical equivalent statements

Show that is logically equivalent to Show that is logically equivalent to

We will construct the truth tables for both sides and determine We will construct the truth tables for both sides and determine that that the truth values for each statement are identical. the truth values for each statement are identical.

The next slide shows that both statements are logically equivaleThe next slide shows that both statements are logically equivalent. nt. The red columns are identical indicating the final truth values The red columns are identical indicating the final truth values of of each statement. each statement.

p q→ p q¬ ∨

Page 12: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement
Page 13: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

6.2 Sets6.2 Sets

This section will discuss the This section will discuss the symbolism and concepts of set symbolism and concepts of set

theory theory

Page 14: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Set properties and set notationSet properties and set notation

Definition of set: A set is any collection of objects Definition of set: A set is any collection of objects specified in such a way that we can determine whether specified in such a way that we can determine whether or not an object is or is not in the collection.or not an object is or is not in the collection.

Example 1. Set A is the set of all the letters in the alphabet. Example 1. Set A is the set of all the letters in the alphabet. Notation: Notation: A = { a, b, c, d, e, A = { a, b, c, d, e, ……z)z) We use capital letters to represent We use capital letters to represent sets. We list the elements of the set within braces. The three dsets. We list the elements of the set within braces. The three dots ots ……indicate that the pattern continues. We can determine that an indicate that the pattern continues. We can determine that an object is or is not in the collection. For example . e A object is or is not in the collection. For example . e A stands for stands for ““e is an element of , or e belongs to set Ae is an element of , or e belongs to set A”” . This statement is true. . This statement is true. The statement The statement ““ 3 A is false, since the number 3 is not an 3 A is false, since the number 3 is not an element of set A. The statement element of set A. The statement ““ 3 3 �� AA”” is true.is true.

∈∈

Page 15: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Null setNull set

Example. What are the real number solutions of the equation? Example. What are the real number solutions of the equation?

Answer: There are no real number solutions of this equation sincAnswer: There are no real number solutions of this equation since e

no real number squared added to one can ever equal 0.no real number squared added to one can ever equal 0. We We represent the solution as the null set represent the solution as the null set { }{ } or or ØØ

2 1 0x + =

Page 16: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Set builder notationSet builder notation

Sometimes it is convenient to represent sets using what is calleSometimes it is convenient to represent sets using what is called d setset--builder notation. For example, instead of representing the set Abuilder notation. For example, instead of representing the set A, , letters in the alphabet by the letters in the alphabet by the roster methodroster method, we can use set , we can use set builder notation: builder notation:

means the same as { a , b , c, d, e , means the same as { a , b , c, d, e , ……z} z}

Example two. { x Example two. { x l } = {3 , l } = {3 , --3} . This is read as the set of all 3} . This is read as the set of all such that the square of x equals 9. The solution set consists ofsuch that the square of x equals 9. The solution set consists of the the two numbers 3 and two numbers 3 and --3. 3.

{ }x x is letter of the English alphabet

2 9x =

Page 17: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Subsets Subsets

A B means A is a subset of B. A is a subset of A if every A B means A is a subset of B. A is a subset of A if every element of A is element of A is also contained in B. For example, the set of integers denoted byalso contained in B. For example, the set of integers denoted by{ { ……--3, 3, --2, 2, --1, 0, 1, 2, 3, 1, 0, 1, 2, 3, ……}} is a subset of the set of real numbers. is a subset of the set of real numbers. Formal definition of subset: A B means if x A, theFormal definition of subset: A B means if x A, the x Bx B

(null set )is a subset of every set. To verify this state(null set )is a subset of every set. To verify this statement, letment, let’’s use the s use the definition of subset. definition of subset. ““ if x , then x is an element of A.if x , then x is an element of A. But since But since the null set contains no elements, the statement the null set contains no elements, the statement x is an element of the x is an element of the null set is falsenull set is false. Hence, we have a conditional statement in which the . Hence, we have a conditional statement in which the premise is false. We know that premise is false. We know that p qp q is true if p is false. Since p is true if p is false. Since p is is false,false, we conclude that the conditional statement is we conclude that the conditional statement is true. true. That is That is ““ if x if x belongs to the null set, then x belongs to set Abelongs to the null set, then x belongs to set A”” is true, which implies that is true, which implies that the null set must be a member of every set. the null set must be a member of every set. Therefore, the null set is a Therefore, the null set is a subset of every setsubset of every set. .

∅⊂ ∈ ∈

∈ ∅

Page 18: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Number of subsets Number of subsets

List all the subsets of set A = {bird, cat, dog} For convenienceList all the subsets of set A = {bird, cat, dog} For convenience, we , we will use the notation A = {b , c, d} to represent set A. will use the notation A = {b , c, d} to represent set A.

Solution: is a subset of A. We also know that every set iSolution: is a subset of A. We also know that every set is a subset s a subset of itself so of itself so A = {b , c, d }A = {b , c, d } is a subset of set A since every element of is a subset of set A since every element of set A is contained within set A. set A is contained within set A.

How many twoHow many two--element subsets are there? element subsets are there? We have We have {b, c}, {b, d} , {c, d{b, c}, {b, d} , {c, d} } How many oneHow many one--element subsets? element subsets? { b} , {c}{ b} , {c} and and {d}{d} . . There is a total of There is a total of 8 subsets of set A8 subsets of set A if you count all the listed subsets. if you count all the listed subsets.

Page 19: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Set operations Set operations

The union of two sets is the set of all elements formed by combiThe union of two sets is the set of all elements formed by combining all ning all the elements of set A and all the elements of set B into one setthe elements of set A and all the elements of set B into one set. .

The symbolism used is The Venn Diagram representing the union ofThe symbolism used is The Venn Diagram representing the union of A A and B is the entire region shaded yellow. and B is the entire region shaded yellow.

{ }A B x x A or x B= ∈ ∈∪AA BB

Page 20: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Example of UnionExample of Union

The union of the rational numbers with the set of irrational numThe union of the rational numbers with the set of irrational numbers bers is the set of real numbers. Rational numbers are those numbers tis the set of real numbers. Rational numbers are those numbers that hat can be expressed as fractions, while irrational numbers are numbcan be expressed as fractions, while irrational numbers are numbers ers that cannot be represented exactly as fractions, such asthat cannot be represented exactly as fractions, such as 2

Rational numbers Rational numbers

a/b, a/b, ¾¾, 2/3 , 0.6, 2/3 , 0.6 Irrational numbers Irrational numbers such as square root such as square root of two, Pi , square of two, Pi , square root of 3root of 3

Real numbers: represented by Real numbers: represented by shaded blueshaded blue--green regiongreen region

Page 21: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Intersection of sets A and BIntersection of sets A and B

The intersection of sets A and B is the set of elements that is The intersection of sets A and B is the set of elements that is common to common to both sets A and Bboth sets A and B. It is symbolized as . It is symbolized as

{ x { x l x l x ��A and x A and x ��B }B }

Represented by Venn Diagrams: Represented by Venn Diagrams:

A B =∩

AA BB

Intersection Intersection

Page 22: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Complement of a setComplement of a set

To understand To understand the complement of a set, we must first define the universal set. The set of all elements under consideration is called the universal set.For example, when discussing numbers, the universal set may consist of the set of real numbers. All other types of numbers (integers, rational numbers, irrational numbers ) are subsets of the universal set of real numbers. Complement of set A: The complement of a set A is defined as the set of elements that are contained in U, the universal set, but not contained in set A. The symbolism for the complement of set A follows:

A’ = { x � U |x� A}

Page 23: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Venn Diagram for complement of set AVenn Diagram for complement of set A

The complement of set A is The complement of set A is represented by the regions represented by the regions that are colored blue and that are colored blue and yellow. The complement of set yellow. The complement of set A is the region A is the region outside outside of the of the white circle representing set A. white circle representing set A.

A

B

Elements of set B that are not in A

Yellow region= all elements in U that are neither in A or B.

A’

A’

Page 24: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

6.3 Basic Counting Principles

In this section, we will see how set operations play an important role in counting techniques.

Page 25: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Opening example To see how sets play a role in counting, consider the following example. In a certain class, there are 23 majors in Psychology, 16 majors in English and 7 students who are majoring in both Psychology and English. If there are 50 students in the class, how many students are majoring in neither of these subjects? B) How many students are majoring in Psychology alone?

Page 26: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

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

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

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

∩A B

Page 27: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

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 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. A similar argument will convince you that there are 9 students who are 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 28: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

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

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

Page 29: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

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

J =joggers

C=Cyclists S=swimmers

1 does all 3

Page 30: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

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

Page 31: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Multiplication principle The tree diagram illustrates the 24 ways to get dressed.

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

Page 32: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Generalized multiplication principle

Suppose that a task can be performed using two or more consecutive operations. If the first operation can be accomplished in m ways and the second operation can be done in n ways, the third operation in p ways and so on, then the complete task can be performed in m·n·p… ways. .

Page 33: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

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

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

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

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

Page 34: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Final example A sportswriter is asked to rank 8 teams in the NBA 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 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 and so on until we get to the 8th place team. There are 8 choices 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 determined from the 6 remaining choices and so on.

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

8 7 6 5 4 3 2 1

Page 35: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

6.4 Permutations and combinations

For more complicated problems, we will need to develop two important concepts: permutations and combinations. Both of these concepts involve what is called the factorial of a number.

Page 36: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Definition of n factorial (!)n! = n(n-1)(n-2)(n-3)…1 For example, 5! = 5(4)(3)(2)(1)=120 0! = 1 by definition.

How it is used in counting: Example. The simplestprotein molecule in biology is called vasopressinand is composed of 8 amino acids that are chemically bound together in a particular order. The order in which these amino acids occur is of vital importance to the proper functioning of vasopressin. If these 8 amino acids were placed in a hat and drawn out randomly one by one, how many different arrangements of these 8 amino acids are possible? Solution: Let A,B,C,D,E,F,G,H symbolize the 8 amino acids. They must fill 8 slots: ___ ___ ___ ___ ___ ___ ___ ___ . There are 8 choices for the first position, leaving 7 choices for the second slot, 6 choices for the third slot and so on. The number of different orderings is 8(7)(6)(5)(4)(3)(2)(1)=8! =40,320.

Page 37: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Example continued: Of the 40,320 possible orderings of the 8 amino acids, the human body can use just one. What is the probability that, by random chance alone with no outside interference, the correct order occurs. We will discuss probability in the next chapter, but here is the answer: Probability of correct order is , an extremely unlikely event.

For more complicated biological molecules, such as hemoglobin, with many more amino acids, the probability that the correct order occurs by random chance alone is extremely small (close to zero!) which raises questions in some scientists’ minds of just how such molecules came to be formed by random chance. Some have concluded that their creation was not due to random chance but by intelligent designwhich raises still more questions that cannot be completely answered.

140,320

Page 38: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Two problems illustrating combinations and permutations.

Consider the following two problems: 1) Consider the set { p , e , n} How many two-letter “words”

(including nonsense words) can be formed from the members of this set?

We will list all possibilities: pe, pn, en, ep, np, ne , a total of 6.

2) Now consider the set consisting of three males: {Paul, Ed, Nick} For simplicity, we will denote the set { p, e, n} How many two-man crews can be selected from this set?

3) Answer: pe (Paul, Ed), pn (Paul, Nick) and en (Ed, Nick) and that is all!

Page 39: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Difference between permutations and combinations

The difference between the two problems is this: Both problems involved counting the numbers of arrangements of the same set {p , e , n}, taken 2 elements at a time, without allowing repetition. However, in the first problem, the order of the arrangements mattered since pe and ep are two different “words”. In the second problem, the order did not matter since pe and ep represented the same two-man crew. So we counted this only once.The first example was concerned with counting the number of permutations of 3 objects taken 2 at a time.

The second example was concerned with the number of combinations of 3 objects taken 2 at a time

Page 40: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Permutations

The notation P(n,r) represents the number of permutations (arrangements) of n objects taken r at a time when r is less than or equal to n. In a permutation, the order is important.

In our example, we have P(3,2) which represents the number of permutations of 3 objects taken 2 at a time.

In our case, P(3,2) = 6 = (3)(2)

In general, P(n,r) = n(n-1)(n-2)(n-3)…(n-r+1)

Page 41: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

More examples Use the definition P(n,r) = n(n-1)(n-2)(n-3)…(n-r+1)

Find P(5,3)Here, n = 5 and r = 3 so we have P(5,3) = (5)(5-1)5-3+1) = 5(4)3 = 60. This means there are 60 arrangements of 5 items taken 3 at a time. Application: How many ways can 5 people sit on a park bench if the bench can only seat 3 people? Solution: Think of the bench as three slots ___ ___ ___ . There are five people that can sit in the first slot, leaving four remaining people to sit in the second position and finally 3 people eligible for the third slot. Thus, there are 5(4)(3)=60 ways the people can sit. The answer could have been found using the permutations formula: P(5,3) = 60, since we are finding the number of ways of arranging 5 objects taken 3 at a time.

Page 42: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

P(n,n)= n(n-1)(n-2)…1 Find P(5,5) , the number of arrangements of 5 objects taken 5 at a time.

Answer: P(5,5) = 5(5-1)…(5-5+1) = 5(4)(3)(2)(1)=120. Application: A bookshelf has space for exactly 5 books. How many different ways can 5 books be arranged on this bookshelf?___ ___ ___ ___ ___ Think of 5 slots, again. There are five choices for the first slot, 4 for the second and so on until there is only 1 choice for the final slot. The answer is 5(4)(3)(2)(1)

which is the same as P(5,5) = 120.

Page 43: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

CombinationsIn the second problem, the number of 2 man crews that can be selected from {p,e ,n} was found to be 6. This corresponds to the number of combinations of 3 objects taken 2 at a time or C(3,2). We will use a variation of the formula for permutations to derive a formula for combinations. Consider the six permutations of { p, e, n} which are grouped in three pairs of 2. Each pair corresponds to one combination of 2.pe pn enep np ne, so if we want to find the number of combinations of 3 objects taken 2 at a time, we simply divide the number of permutations of 3 objects taken 2 at a time by 2 (or 2!) We have the following result: C(3,2) =

(3, 2)2!

P

Page 44: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Generalization General result: This formula gives the number of subsets of size r that can be taken from a set of n objects. The order of the items in each subset does not matter.

( , ) ( 1)( 2)...( 1)( , )! ( 1)( 2)...1

P n r n n n n rC n rr r r r

− − − += =

− −

Page 45: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Examples

Find C(8,5)Solution: C(8,5) =

2. Find C(8,8)

Solution: C(8,8) =

(8,5) 8(7)(6)(5)(4) 8(7)(6) 8(7) 565! 5(4)(3)(2)(1) 3(2)(1)

P= = = =

(8,8) 8(7)(6)(5)(4)(3)(2)(1) 18! 8(7)(6)(5)(4)(3)(2)(1)

P= =

Page 46: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Combinations or Permutations? 1. In how many ways can you choose 5 out of 10 friends to invite to a dinner party? Solution: Does the order of selection matter? If you choose friends in the order A,B,C,D,E or A,C,B,D,E the same set of 5 was chosen, so we conclude that the order of selection does not matter. We will use the formula for combinations since we are concerned with how many subsets of size 5 we can select from a set of 10. C(10,5) = (10,5) 10(9)(8)(7)(6) 10(9)(8)(7) 2(9)(2)(7) 252

5! 5(4)(3)(2)(1) (5)(4)P

= = = =

Page 47: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Permutations or Combinations?

How many ways can you arrange 10 books on a bookshelf that has space for only 5 books?

Does order matter? The answer is yes since the arrangement ABCDE is a different arrangement of books than BACDE. We will use the formula for permutations. We need to determine the number of arrangements of 10 objects taken 5 at a time so we have P(10,5) = 10(9)(8)(7)(6)=30,240

Page 48: 6.1 Logic - Governors State University understand the logic behind the truth table for the conditional ... The red columns are identical indicating the final truth values of each statement

Lottery problem

A certain state lottery consists of selecting a set of 6 numbers randomly from a set of 49 numbers. To win the lottery, you must select the correct set of six numbers. How many possible lottery tickets are there?

Solution. The order of the numbers is not important here as long as you have the correct set of six numbers. To determine the total number of lottery tickets, we will use the formula for combinations and find C(49, 6), the number of combinations of 49 items taken 6 at a time. Using our calculator, we find that C(49,6) = 13,983,816