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.
What is a tautology?
A tautology is a formula which is TRUE in every possible interpretation.
When is a formula contingent?
A formula is contingent if it is TRUE in some possible interpretations and FALSE in others.
When would two WFFs be logically equivalent, and how is this written?
Given two WFFs, A1 and A2, A1 is logically equivalent to A2 if A1 and A2 have the same value in all interpretations.
This is written as A1 ⇔ A2.
What is a valid argument?
An argument is valid only if there is no interpretation in which the premises are TRUE and the conclusion is FALSE.
Is the following argument valid?
R ∧ S
¬R ∨ Q
S → Q
The argument is valid.
There is only one interpretation in which both premises are TRUE (the interpretation where Q, R and S are all TRUE). as the conclusion is also TRUE in this interpretation, the argument is valid.
Is the following argument valid?
David is a programmer, or Sara is a doctor
If Sara is not a doctor, then Michael is a salesman
David is a programmer or Michael is a salesman
The argument is invalid.
Assuming we assign variables to each of the three basic propositions:
- D: David is a programmer
- S: Sara is a doctor
- M: Michael is a salesman
We can then translate the English argument to logic:
D ∨ S
¬S → M
D ∨ M
There is an interpretation in which the premises are TRUE, but the conclusion is FALSE. In that interpretation, D = FALSE, M = FALSE and S = TRUE. The premises are TRUE, but the conclusion is FALSE, therefore the argument is invalid.