From the course: Programming Foundations: Discrete Mathematics
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Sets from Cartesian products
From the course: Programming Foundations: Discrete Mathematics
Sets from Cartesian products
- [Voiceover] Creating sets from Cartesian products. Cartesian products are a result of taking two sets, such as sets A and B, and creating a list of ordered pairs. A more formal definition looks like this. A cross B is equal to the ordered pairs of a comma b, such that little A is an element of set A, and little B is an element of set B. Using this formula, if we have sets A a set of all students at a college, and B, a set of all courses at the college, A times B would be the set of all student and course combinations. To predetermine the number of ordered pairs we can take the cardinality of set A times the cardinality of set B. That gives us the number of ordered pairs. In this example, we will keep it simple and say that we have two students and three possible courses. The cardinality of A is two, the cardinality of B is three, so we will end up with six ordered pairs. To find the Cartesian product of these two sets we start by taking a value from the first set, such as s1, and we…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Objects as sets2m 56s
-
(Locked)
Set notation3m 56s
-
(Locked)
Set operations5m 1s
-
(Locked)
Power sets4m 29s
-
(Locked)
Sequences and sums7m 22s
-
Recursion3m 5s
-
(Locked)
Cardinality, disjointness, and partitions2m 19s
-
(Locked)
Sets from Cartesian products3m 2s
-
(Locked)
Challenge: Practice with sets47s
-
(Locked)
Solution: Practice with sets6m 53s
-
(Locked)
-
-
-
-
-
-