1.
Year 1 LESSON 4BASIC CONCEPT OF SETS♦ A set is a collection of related items♦ Each items is called an element or member of the set CS113/0401/v1 Lesson 4 - 1
2.
Year 1 EXAMPLESa. { Badminton, Basketball, Baseball } is a set of games beginning with the letter Bb. { Jan, Jun, Jul } is a set of months of the year beginning with the letter Jc. { 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 } CS113/0401/v1 Lesson 4 - 2
3.
Year 1 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’) CS113/0401/v1 Lesson 4 - 3
4.
Year 1 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 S i.e. A ⊂ S, B ⊂ S, C ⊂ S A ⊂ B, Ø ⊂ A, Ø ⊂ B Ø ⊂ C, { } ⊂ A Note: An empty set is a subset of all sets CS113/0401/v1 Lesson 4 - 4
5.
Year 1 VENN DIAGRAMS♦ Used to represent the relationships between sets in a universal set, e.g ∪ C D Example: IF U={1, 2, 3, 4, 5, 6, 7, 8} AND C={1, 3, 5} D={1, 2, 3, 4, 5} C⊂D⊂∪ ∪ 2 4 1 5 3 C 6, 7, 8 D CS113/0401/v1 Lesson 4 - 5
6.
Year 1 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} CS113/0401/v1 Lesson 4 - 6
7.
Year 1 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} CS113/0401/v1 Lesson 4 - 7
8.
Year 1 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} CS113/0401/v1 Lesson 4 - 8
9.
Year 1 DISJOINT SETS♦ The sets A and B are disjoint if they have no elements in common♦ Notation: A ∩ B = Ø ∪ C D♦ Example: • U = { 1, 2, 3, 4, 5, 6, 7 } • A = { 1, 2, 3 } • B = { 5, 6, 7 } CS113/0401/v1 Lesson 4 - 9
10.
Year 1SAMPLE VENN DIAGRAMS CS113/0401/v1 Lesson 4 - 10
11.
Year 1 EXERCISE♦ Shade the following a. A ∩ B A B b. A ∪ B c. (B ∩ A) d. A’ ∩ B’ e. A’ ∪ B’♦ Shade the following a. (A’ ∩ B) ∪ C A b. (A ∩ C) ∪ B c. (A’ ∩ C’) ∩ B d. (A’ ∪ B’) ∪ C’ e. (A’ ∩ B’) ∩ C’ B C f. (A ∪ C)’ ∩ C CS113/0401/v1 Lesson 4 - 11
12.
Year 1 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) CS113/0401/v1 Lesson 4 - 12
14.
Year 1 SET THEORY♦ n ( A ) denotes number of elements in the set A♦ for 2 SETS A B n(A ∪ B) = n(A) + n(B) - n(A ∩ B)♦ for 3 SETS A B C n(A ∪ B ∪ C)=n(A) + n(B) + n(C) - n(A ∩ B) - n(A ∩ C) - n(B ∩ C) + n(A ∩ B ∩ C) CS113/0401/v1 Lesson 4 - 14
15.
Year 1 EXAMPLEGiven :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) Ub. Q’ ∩ P 3 5c. (P ∪ Q)’ P 2 7 11 1 9 Qd. P’ ∩ Q 13 468 12 10a. n(P ∩ Q) = 5b. Q’ ∩ P = {2}c. (P ∪ Q)’ = {4, 6, 8, 10, 12}d. P’ ∩ Q = {1, 9} CS113/0401/v1 Lesson 4 - 15
16.
Year 1 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)CS113/0401/v1 Lesson 4 - 16
17.
Year 1 EXAMPLES In 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) = x G Hn(H) = 4+xn(G ∪ H)= ?n(H) = 4+x16 = 4+xx = 16 - 4 = 12n(G ∪ H)= n(G) + n(H) - n(G ∪ H)20 = 16 + 12 - xx = 28 - 20 = 8 CS113/0401/v1 Lesson 4 - 17
18.
Year 1 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. CS113/0401/v1 Lesson 4 - 18
19.
Year 1 SETSa. 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. CS113/0401/v1 Lesson 4 - 19
20.
Year 1 SETSb. If students are selected at RANDOM and 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. CS113/0401/v1 Lesson 4 - 20
21.
Year 1 DEFINATION OF PROBABILITY♦ 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 EP(E) = No. of total possible outcomes CS113/0401/v1 Lesson 4 - 21
22.
Year 1 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 CS113/0401/v1 Lesson 4 - 22
23.
Year 1PROBABILITY EXAMPLES (1)♦ 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 CS113/0401/v1 Lesson 4 - 23
24.
Year 1PROBABILITY EXAMPLE (2)♦ Using a six sided dice • Probability of throwing a 5 1 = 6 • Probability of an even number 3 1 = 6 = 2 • Probability of throwing 7 = 0 = impossible • Probability of throwing 1 to 6 =1 = certain 1=certain, 0=impossible CS113/0401/v1 Lesson 4 - 24
25.
Year 1 “SUCCESS” AND “FAILURE”In probability theory, if an event occurs,we say have a success. The probabilityof a success is defined as: No. of successesp= No. of possible occurrenceIf the event we are concerned with doesnot occur, we have therefore a failure.The probability of a failure is symbolizedas q. No. of failuresp= No. of possible occurrenceSince we have either failure of successfor an event, and the total probability is1, therefore p+q=1CS113/0401/v1 Lesson 4 - 25
26.
Year 1 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 CS113/0401/v1 Lesson 4 - 26
27.
Year 1 COMPOUND EVENTS♦ A compound is a combination of two or more independent events “Both A and B” Two types : “Either A or B” CS113/0401/v1 Lesson 4 - 27
28.
Year 1 ‘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) CS113/0401/v1 Lesson 4 - 28
29.
Year 1 “BOTH A AND B” (2) 1P(System Fail) = 20 1P(Designer on Holiday) = 10P(System Fail and Designer on Holiday) 1 1 1 = 20 x 10 = 200P(Designer not on Holiday) 1 9 = 1 - 10 = 10P(System Fail and Designer not on Holiday) 1 9 9 = 20 x 10 = 200 CS113/0401/v1 Lesson 4 - 29
30.
Year 1 “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)♦ SimilarlyP(A or B or C) = P(A) + P(B) + P (C) CS113/0401/v1 Lesson 4 - 30
31.
Year 1 “EITHER A OR B” (2)♦ 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 CS113/0401/v1 Lesson 4 - 31
32.
Year 1 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. CS113/0401/v1 Lesson 4 - 32
33.
Year 1 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. CS113/0401/v1 Lesson 4 - 33
34.
Year 1 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. CS113/0401/v1 Lesson 4 - 34
35.
Year 1 TREE DIAGRAMSP (use spreadsheet, load correctly) 3 = x 0.9 = 0.675 4P (use spreadsheet, load wrongly) 3 = x 0.1 = 0.075 4P (use others, load correctly) 1 = x 0.9 = 0.225 4P (use others, load correctly) 1 = x 0.1 = 0.025 4Examples: Produce a probability tree to show the eight outcomes of the experiment including the three even that :The company database needs updating with aprobability of 1/4The database manager is in a meeting with a CS113/0401/v1probability of 1/5 Lesson 4 - 35
Be the first to comment