If A and B are sets, several other sets can be constructed from them: the intersection of A and B, АПВ3 (x: хEA and x € B}; /| B N A = A N B. the union of A and B, AUB 3 (x: x Е A or x € B}; // BUA = A U B. and the set difference, A but not B, A\B {x: x € A and x ¢ B}. // Is B \ A = A \ B? // The set A \ B is sometimes called the "relative complement" of B in A. When A N B = Ø, sets A and B are said to be disjoint. /| A and B have no common element. The number of elements in a set S is called the cardinality of S and denoted by |S|. When this is a finite number, then |S| e N, and when |S = n, we’ll say that S is an n-set. For any pair of sets, |AUB| = |A|+|B| – |AN B|, and when A and B are disjoint, |AUB| = |A|+ |B|. // since AN B = Ø Furthermore, we always have |AUB| = |A \ B| +|B \ A| + |A N B|. Example 2.1.1: Operations, Sizes, and Subsets Suppose A is the set of odd integers less than 10 and B is the set of primes less than 10. Then = {2,3,5,7} A = {1,3,5,7,9} and ANB = {3,5,7} and AUB = {1,2,3,5,7,9} A \ B = {1,9} and B \ A = {2}; - |AN B| = 5+4 – 3 = |A \ B| + |B \ A| + |A N B| = 2+1+3. 6 = |AUB| = |A| + |B|

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 5PE
icon
Related questions
icon
Concept explainers
Question
100%

Let A be the set {1,3,5,7,9} and B be the set {1,2,4,8} . Find |A⋃B|

2.1.2
Operations on Sets and Cardinality
If A and B are sets, several other sets can be constructed from them:
the intersection of A and B,
A N B=
{x: х € A and х€ B};
// BN A = A N B.
the union of A and B,
AUB 3D (x: хЕAor x € B};
// BUA= A U B.
and
the set difference, A but not B,
A\B
{x: x € A and x ¢ B}.
// Is B \ A = A \ B?
// The set A \ B is sometimes called the "relative complement" of B in A.
When A N B = Ø, sets A and B are said to be disjoint.
// A and B have no common element.
The number of elements in a set S is called the cardinality of S and denoted
by S. When this is a finite number, then |S E N, and when |S = n, we'll say that
S is an n-set. For any pair of sets,
|AUB| = |A|+|B| – |AN B|,
and when A and B are disjoint,
|AUB| = |A|+ |B|.
// since AN B = Ø
Furthermore, we always have
|AUB| = |A \ B| + |B \ A| + |A N B|.
Example 2.1.1: Operations, Sizes, and Subsets
Suppose A is the set of odd integers less than 10 and B is the set of primes less
than 10. Then
A = {1,3,5,7,9} and
ANB = {3,5,7} and
A \ B = {1,9}
{2,3,5,7}
= {1,2,3,5,7,9}
B \ A = {2};
B =
AUB=
and
%3D
6 = |AUB| = |A|
- |AN B| = 5+4 – 3
= |A \ B| + |B \ A| + |AN B| = 2+1+3.
+ |B|
%3D
%3D
Transcribed Image Text:2.1.2 Operations on Sets and Cardinality If A and B are sets, several other sets can be constructed from them: the intersection of A and B, A N B= {x: х € A and х€ B}; // BN A = A N B. the union of A and B, AUB 3D (x: хЕAor x € B}; // BUA= A U B. and the set difference, A but not B, A\B {x: x € A and x ¢ B}. // Is B \ A = A \ B? // The set A \ B is sometimes called the "relative complement" of B in A. When A N B = Ø, sets A and B are said to be disjoint. // A and B have no common element. The number of elements in a set S is called the cardinality of S and denoted by S. When this is a finite number, then |S E N, and when |S = n, we'll say that S is an n-set. For any pair of sets, |AUB| = |A|+|B| – |AN B|, and when A and B are disjoint, |AUB| = |A|+ |B|. // since AN B = Ø Furthermore, we always have |AUB| = |A \ B| + |B \ A| + |A N B|. Example 2.1.1: Operations, Sizes, and Subsets Suppose A is the set of odd integers less than 10 and B is the set of primes less than 10. Then A = {1,3,5,7,9} and ANB = {3,5,7} and A \ B = {1,9} {2,3,5,7} = {1,2,3,5,7,9} B \ A = {2}; B = AUB= and %3D 6 = |AUB| = |A| - |AN B| = 5+4 – 3 = |A \ B| + |B \ A| + |AN B| = 2+1+3. + |B| %3D %3D
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Types of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning