Unit 6 Flashcards
What is the cardinality of the set derived from the list of integers [4, 6, 8, 12, 6].
4
The cardinality of a set is the number of members within that set. In this case, we would ignore the second 6 when creating the set, leaving us with 4 members in total.
Suppose that:
A is the set {john, mary, anil}
B is the set {anil, mary}
C is the set ∅.
Which of the following is true?
Select one or more:
- A U B = A
- A C B
- A n C = ∅
- C - B = {anil, mary}
- {anil, mary} ∊ A n B
- A U B = A
- A n C = ∅
Using the attached tables, what would be the result of the following SQL query?
SELECT *
FROM student
Using the attached tables, what would be the result of the following SQL query?
SELECT FirstName, LastName
FROM student
WHERE ModuleCode = ‘M269’
Using the attached tables, what would be the result of the following SQL query?
SELECT FirstName, LastName, Level
FROM student CROSS JOIN module
WHERE Module = ModuleCode
What is a set?
A set is an unordered collection of distinct entities.
For example, the list of numbers [4, 5, 8, 6, 4, 3, 4, 5, 8, 3, 7, 5, 7] would be formed into the following set (the order of the set is unimportant):
{3, 4, 5, 6, 7, 8}
What is a set enumeration?
A set enumeration is when a set is written with all elements explicitly listed, for example, {3, 4, 5, 6, 7, 8}.
What is a set comprehension?
A set comprehension is used to describe a set where the enumeration would be too complicated, or too lengthy to write down.
For example, the set comprehension {x : x is a whole number between 3 and 8} would describe the set enumeration {3, 4, 5, 6, 7, 8}.
What would the set be for the following list of numbers:
5, 2, 8, 3, 5, 6, 2, 5, 9, 4, 6, 7
{2, 3, 4, 5, 6, 7, 8, 9}
What would be the set enumeration described by the following set comprehension:
{x : x is a whole number between 23 and 34}
{23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34}
How would you write an empty set?
ø or {}.
Remember that the set of an empty set is not the same as the empty set itself, so the set {ø} is not the same as ø.
What do the following expressions mean?
- x is a member of the set ‘S’, or x is an element of the set ‘S’
- x is not a member of the set ‘S’, or x is not an element of the set ‘S’
What do the following expressions mean?
- The empty set is a subset of set ‘A’
- Set ‘A’ is a subset of itself
- Set ‘A’ is a proper subset of set ‘B’
What does the following expression mean, when dealing with sets?
A = B
Set ‘A’ is equal to set ‘B’.
Equality of sets can also be defined in terms of subsets:
A = B if A is a proper subset of B, and B is a proper subset of A.
What do the following expressions mean, and what would be the resulting sets?
- The union of sets {1, 2, 3} and {3, 4, 5}. The resulting set would be {1, 2, 3, 4, 5}
- The union of the empty set and set ‘A’. The resulting set would be set ‘A’
What do the following expressions mean, and what would be the resulting sets?
- The intersection of sets {1, 2, 3} and {3, 4, 5}. The resulting set would be {3}.
- The intersection of the empty set and set ‘A’. The resulting set would be the empty set.
What do the following expressions mean, and what would be the resulting sets?
All these expressions show the difference between two sets.
The resulting sets would be:
- {a, c, e}
- {1, 2}
- {5, 6}
- {x : x is an odd number}
What is a tuple?
A tuple is a sequence of elements which is ordered and can contain duplicates. A tuple is written with round brackets rather than curly brackets.
Two tuples are only the same if they have the same elements in the same order.
E.g. (3, 1, 1) is not the same as (1, 1, 3) or (3, 1).
A 0-tuple with no members is written as ().
What is the Cartesian product?
The Cartesian product for two sets is the set of all the ordered pairs (x, y), where x is a member of set ‘A’ and y is a member of set ‘B’.
What is the Cartesian product of the following two sets?
{1, 2} and {1, 3, 5}
{(1, 1), (1, 3), (1, 5), (2, 1), (2, 3), (2, 5)}
What is a well-formed formula (WFF) of propositional logic?
Given a set of propositional variables, {}, a well-formed formula (WFF) of propositional logic is any of:
- a propositional variable
- ¬A, where A is a WFF
- (A ∧ B), where A and B are WFFs
- (A ∨ B), where A and B are WFFs
- (A → B), where A and B are WFFs
Nothing else is a WFF.
What is an interpretation of a set of WFFs?
An interpretation of a set of WFFs is an assignment of one of the truth values (TRUE or FALSE) to each of the variables.
When is a WFF satisfiable?
A WFF is satisfiable only if there exists at least one interpretation in which that WFF is TRUE.
A set of WFFs is satisfiable only if there exists at least one interpretation in which every WFF in the set is TRUE.
In these cases, the interpretation is said to satisfy the WFF or WFFs.
What is a contradiction?
A contradiction is a formula which is FALSE in every possible interpretation.