35
Lesson 4 - 1 Year 1 CS113/0401/ v1 LESSON 4 BASIC CONCEPT OF SETS A set is a collection of related items Each items is called an element or member of the set

MELJUN CORTES - Sets

Embed Size (px)

DESCRIPTION

MELJUN CORTES - Sets

Citation preview

Page 1: MELJUN CORTES - Sets

Lesson 4 - 1

Year 1

CS113/0401/v1

LESSON 4BASIC CONCEPT OF SETS

A set is a collection of related items

Each items is called an element or member of the set

Page 2: MELJUN CORTES - Sets

Lesson 4 - 2

Year 1

CS113/0401/v1

EXAMPLES

a. { Badminton, Basketball, Baseball } is a set of games beginning with the letter B

b. { Jan, Jun, Jul } is a set of months of the year beginning with the letter J

c. { 2, 3, 5, 7, 11, 13, … } is a set of prime numbers

Use set symbols

a. A = { Badminton, Basketball,

Baseball }

b. B = { Jan, Jun, Jul }

c. C = { 2, 3, 5, 7, 11, 13 }

Page 3: MELJUN CORTES - Sets

Lesson 4 - 3

Year 1

CS113/0401/v1

SETS

Universal set Contains all possible set of

elements under discussion

Universal set denoted by

U ,

Empty set (Null set) A set with no elements

NULL SET denoted by

Ø, { }

Note that {0} is not a null set

(it contains the element ‘0’)

Page 4: MELJUN CORTES - Sets

Lesson 4 - 4

Year 1

CS113/0401/v1

SUBSETS

A set P is a subset of U if every member of set P is a member of set U

i.e. P U

Example: IF S = { p, q, r, s }AND A = { p, q }

B= { p, q, r }C= { q, r, s }

Then A, B, C, are subsets of Si.e. A S, B S, C S

A B, Ø A, Ø BØ C, { } A

Note: An empty set is a subset of all sets

Page 5: MELJUN CORTES - Sets

Lesson 4 - 5

Year 1

CS113/0401/v1

Used to represent the relationships between sets in a universal set, e.g

Example:IF U={1, 2, 3, 4, 5, 6, 7, 8}AND C={1, 3, 5}

D={1, 2, 3, 4, 5} C D

C D

D

35

1

C

42

6, 7, 8

VENN DIAGRAMS

Page 6: MELJUN CORTES - Sets

Lesson 4 - 6

Year 1

CS113/0401/v1

SETS

Intersection The set whose elements are

common to both sets

Notation: A B

= { x : x A and x B }

Given :

A = {a,b,c,d,e}

B = {c,d,f,g}

c = A B = {c,d}

Page 7: MELJUN CORTES - Sets

Lesson 4 - 7

Year 1

CS113/0401/v1

SETS Union

The set whose elements occurs in 1 set or the other or both

Notation: A B

= {x : x A and/or x B}

Example :

IF A = {a,b,c,d,e}

B = {c,d,f,g}

Then

C = A B = {a,b,c,d,e,f,g}

Page 8: MELJUN CORTES - Sets

Lesson 4 - 8

Year 1

CS113/0401/v1

COMPLEMENTS

The complement of a set A in a given universal set U is the set whose elements are members of U but not members of A

Notation: A’ = { x : x A }

IF U = {1,2,3,4,5} and A = {2,4}

Complement of A = A’ or A

= {1,3,5}

Page 9: MELJUN CORTES - Sets

Lesson 4 - 9

Year 1

CS113/0401/v1

The sets A and B are disjoint if they have no elements in common

Notation: A B = Ø

Example: U = { 1, 2, 3, 4, 5, 6, 7 }

A = { 1, 2, 3 }

B = { 5, 6, 7 }

C D

DISJOINT SETS

Page 10: MELJUN CORTES - Sets

Lesson 4 - 10

Year 1

CS113/0401/v1

SAMPLE VENN DIAGRAMS

Page 11: MELJUN CORTES - Sets

Lesson 4 - 11

Year 1

CS113/0401/v1

A B

A

B C

EXERCISE

Shade the following

a. A Bb. A Bc. (B A)d. A’ B’e. A’ B’

Shade the following

a. (A’ B) Cb. (A C) Bc. (A’ C’) Bd. (A’ B’) C’e. (A’ B’) C’f. (A C)’ C

Page 12: MELJUN CORTES - Sets

Lesson 4 - 12

Year 1

CS113/0401/v1

PROPERTIES OF SETS

Commutative Property

A B = B A

A B = B A

Associative Property

(A B) C = A (B C)

(A B) C = A (B C)

Distributive Property

A (B C) = (A B) (A C)

A (B C) = (A B) (A C)

Page 13: MELJUN CORTES - Sets

Lesson 4 - 13

Year 1

CS113/0401/v1

RELATION

A A = A

A Ø = A

A U = U

A A = A

A U = A

A Ø = Ø

U’ = Ø

Ø’ = U

Page 14: MELJUN CORTES - Sets

Lesson 4 - 14

Year 1

CS113/0401/v1

n ( A ) denotes number of elements in the set A

for 2 SETS

n(A B) = n(A) + n(B) - n(A B)

for 3 SETS

n(A B C)=n(A) + n(B) + n(C) -

n(A B) - n(A C) -

n(B C) +

n(A B C)

A B

B

A

C

SET THEORY

Page 15: MELJUN CORTES - Sets

Lesson 4 - 15

Year 1

CS113/0401/v1

Given :Universal Set U

={0 < natural No < 14}P ={ Prime Numbers: P U }Q ={Odd Numbers: Q U }

Using a Venn diagram find :

a. n(P Q)b. Q’ Pc. (P Q)’d. P’ Q

a. n(P Q) = 5b. Q’ P = {2}c. (P Q)’ = {4, 6, 8, 10, 12}d. P’ Q = {1, 9}

U

10

2 Q1 9P3

124 6 8

1175

13

EXAMPLE

Page 16: MELJUN CORTES - Sets

Lesson 4 - 16

Year 1

CS113/0401/v1

EXERCISE

U={-4, -3, -2, -1, 0, 1, 2, …, 12}

A={2, 3, 4, 5, 6}

B={1, 3, 6, 11, 12}

C={-3, -4, 4, 6}

D={5, 6}

E={-4, -2, -1, 3, 4}

Find the following

a. (A B) E

b. (B D) A

c. (B E)’

d. (B E) (B C)

Page 17: MELJUN CORTES - Sets

Lesson 4 - 17

Year 1

CS113/0401/v1

G H

EXAMPLESIn a class of 20 boys, every boy studied either History or Geography or both. The number who studied History was 4 greater than the number who studied Geography. If 16 studied History, how many studied both?

Given :n(G H)= 20n(G) = xn(H) = 4 + xn(G H)= ?

n(H) = 4 + x16 = 4 + xx = 16 - 4

= 12

n(G H)= n(G) + n(H) - n(G H)20 = 16 + 12 - xx = 28 - 20

= 8

Page 18: MELJUN CORTES - Sets

Lesson 4 - 18

Year 1

CS113/0401/v1

SETS

A college course has 100 students all of whom have access to wordprocessor,spreadsheet and database packages.

A survey showed that: 32 did NOT use ANY of the software.

14 used ONLY the wordprocessor.

8 used ONLY the spreadsheet.

9 used ONLY the database

5 used the database AND

spreadsheet.

2 used ALL THREE packages.

Page 19: MELJUN CORTES - Sets

Lesson 4 - 19

Year 1

CS113/0401/v1

SETS

a. i. Draw a VENN DIAGRAM with all sets ENUMERATED

as far as possible. LABEL the two subsets which you can’t as yet

enumerate as ‘x’ and ‘y’, in any order.

ii. Complete the equation x + y = ?

Further inquiries showed that twice as many students used the wordprocessor AND database as used the wordprocessor AND spreadsheet.

iii. WRITE down and SIMPLIFY another equation in x and y to represent this.

iv. SOLVE the simultaneous equation from ii. and iii.

Page 20: MELJUN CORTES - Sets

Lesson 4 - 20

Year 1

CS113/0401/v1

SETS

b. If students are selected at RANDOMand WITHOUT REPLACEMENT from this course state as FRACTIONS, the PROBABILITY that :-

i. A student will have used none of the packages.

ii. If two students are selected only one will have used any of the

three packages.

iii. At least one of the students in part ii. Will used all three

packages.

Page 21: MELJUN CORTES - Sets

Lesson 4 - 21

Year 1

CS113/0401/v1

We can measure probability by considering how often an event occurs in relation to how often it could occur. It is normally given in terms of a ratio. An event is an occurrence.

No. of outcomes that satisfy event E

P(E) = No. of total possible outcomes

DEFINATION OF PROBABILITY

Page 22: MELJUN CORTES - Sets

Lesson 4 - 22

Year 1

CS113/0401/v1

DEFINATION OF PROBABILITY

Example : Tossing a coin, throwing a dice. If a coin, when tossed, has one

chance in two of turning up a hear, we say that the probability of getting a head is 1/2. When many coins are tossed, it is likely that about one half of them will turn up heads. In symbols, we write this as :

P(Head) = 1/2

If a dice, when tossed, has one chance in six of turning up with the face containing six dots, we say that the probability for the face with six dots to turn up is 1/6. In symbols, we write this as :

P(P) = 1/6

Page 23: MELJUN CORTES - Sets

Lesson 4 - 23

Year 1

CS113/0401/v1

Given 52 play cards Probability of picking a spade

13 1

= 52 = 4

Probability of picking a king

4 1

= 52 = 13

Probability of picking the king of

spade

= 1

52

PROBABILITY EXAMPLES (1)

Page 24: MELJUN CORTES - Sets

Lesson 4 - 24

Year 1

CS113/0401/v1

Using a six sided dice Probability of throwing a 5

1= 6

Probability of an even number3 1

= 6 = 2

Probability of throwing 7= 0 =impossible

Probability of throwing 1 to 6 = 1 = certain1 =certain, 0=impossible

PROBABILITY EXAMPLE (2)

Page 25: MELJUN CORTES - Sets

Lesson 4 - 25

Year 1

CS113/0401/v1

In probability theory, if an event occurs, we say have a success. The probability of a success is defined as:

No. of successes

p= No. of possible occurrence

If the event we are concerned with does not occur, we have therefore a failure. The probability of a failure is symbolized as q.

No. of failures

p= No. of possible occurrence

Since we have either failure of success for an event, and the total probability is 1, therefore

p + q = 1

“SUCCESS” AND “FAILURE”

Page 26: MELJUN CORTES - Sets

Lesson 4 - 26

Year 1

CS113/0401/v1

NOTATION

The probability of an event E is given by P(E)

If E is “success”, then

P(E)=p

If several possibilities, use subscripts

e.g. p1 p2 p3 etc

Page 27: MELJUN CORTES - Sets

Lesson 4 - 27

Year 1

CS113/0401/v1

A compound is a combination of two or more independent events

“Both A and B”

Two types :

“Either A or B”

COMPOUND EVENTS

Page 28: MELJUN CORTES - Sets

Lesson 4 - 28

Year 1

CS113/0401/v1

‘BOTH A AND B” (1)

The probability of two independent events both occurring is the product of the individual probabilities

P(A and B) = P(A) x P(B)

Similarly

P(A and B and C) = P(A) x P(B) x P(C)

Page 29: MELJUN CORTES - Sets

Lesson 4 - 29

Year 1

CS113/0401/v1

1P(System Fail) = 20

1P(Designer on Holiday) = 10

P(System Fail and Designer on Holiday)

1 1 1= 20 x 10 = 200

P(Designer not on Holiday)

1 9= 1 - 10 = 10

P(System Fail and Designer not on Holiday)

1 9 9= 20 x 10 = 200

“BOTH A AND B” (2)

Page 30: MELJUN CORTES - Sets

Lesson 4 - 30

Year 1

CS113/0401/v1

“EITHER A OR B” (1)

The probability of either of two independent events occurring is the sum of the individual probabilities

P(A or B) = P(A) + P(B)

Similarly

P(A or B or C) = P(A) + P(B) + P (C)

Page 31: MELJUN CORTES - Sets

Lesson 4 - 31

Year 1

CS113/0401/v1

P(Designer on Holiday) 1

= 10

P(Engineer on Call) 2

= 3

P(Engineer on Call or Designer on Holiday)

1 2 23= 23 + 3 = 30

P(System Fail and (Engineer on Call or Designer on Holiday))

1 23 23= 20 x 30 = 600

“EITHER A OR B” (2)

Page 32: MELJUN CORTES - Sets

Lesson 4 - 32

Year 1

CS113/0401/v1

TREE DIAGRAMS

A ( rooted ) tree diagram augments the fundamental principle of counting by exhibiting all possible outcomes of a sequence of events where each event can occur in a finite number of ways.

Page 33: MELJUN CORTES - Sets

Lesson 4 - 33

Year 1

CS113/0401/v1

TREE DIAGRAMS

Examples :

Marc and Erik are to play a tennis tournaments. The first person to win two games in a row or to win a total of three games wins the tournament. The figure below gives a tree diagram which show how the tournament can be.

The path from the beginning of the tree to a particular endpoint describes who won which game in that particular course.

Page 34: MELJUN CORTES - Sets

Lesson 4 - 34

Year 1

CS113/0401/v1

TREE DIAGRAMS

Examples :

If the probability that you will use a particular spreadsheet system is 3/4 and the probability that the software loads correctly is 0.9, there are 4 possible results when you try to use that spreadsheet. Draw the appropriate probability tree to illustrate this situation and calculate the probability if each of the 4 possible outcomes.

Page 35: MELJUN CORTES - Sets

Lesson 4 - 35

Year 1

CS113/0401/v1

TREE DIAGRAMS

P (use spreadsheet, load correctly) 3

= x 0.9 = 0.6754

P (use spreadsheet, load wrongly) 3

= x 0.1 = 0.0754

P (use others, load correctly)1

= x 0.9 = 0.2254

P (use others, load correctly) 1

= x 0.1 = 0.0254

Examples: Produce a probability tree to show the eight outcomes of the experiment including the three even that :

The company database needs updating with a probability of 1/4

The database manager is in a meeting with a probability of 1/5

The database maintainer is on holiday with a probability of 1/8