Page 177 - Artificial Intellegence_v2.0_Class_11
P. 177

In the example below, the divide operation will return every tuple from the first relation that matches all tuples of the
                 second relation.
                 Student                                                        Task
                   Student              Task
                     Vivek      Studying plant growth                                Task Name

                     Vivek         Creating games                               Studying plant growth
                    Jimmy             Floor duty                                   Creating games
                    Jimmy          Creating games
                    Sudha       Studying plant growth
                    Sudha          Creating games



                 Student ÷ Task (Students who completed all tasks given in Relation Task).
                   Vivek

                   Sudha



                        Set Operations

                 When two or more sets are combined to form another set according to the mathematical principles of sets, the
                 process is called set operation. Let us study the four important set operations:

                 Set Union
                 The union of two sets A and B is the set of elements that are in A, in B, or in both A and B. It
                 is denoted by A U B. For example: If A = {20, 21, 22, 23} and B = {23, 24, 25}, then:

                 A ∪ B = {20, 21, 22, 23, 24, 25}. (The common elements occur only once).
                                                                                                          A       B

                                        Set Intersection
                                        The intersection of sets A and B is the set of elements that are common in A and B. It is
                                        denoted by A ∩ B. For example:
                                        If A = {21, 22, 23} and B = {23, 24, 25}, then A ∩ B = {23}.
                      A       B
                 Set Difference
                 The difference between two sets is the set containing elements that are in A but not in B. It
                 is denoted by A – B.
                 For example:
                                                                                                          A        B
                 A = {21, 22, 23, 24, 25} and B = {22, 24, 26, 28}, then A – B = {21, 23, 25}.

                 Complement of Set
                 The complement of a set A (denoted by A’) is the set of elements that are not in set A. A’= (U - A) where U is a universal
                 set that contains all objects. For example:
                 Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9} and A = {2, 4, 6, 8}
                 Then A’ = {1, 3, 5, 7, 9}.





                                                                                                 Maths for AI   175
   172   173   174   175   176   177   178   179   180   181   182