Unit 6 Flashcards

1
Q

What is the cardinality of the set derived from the list of integers [4, 6, 8, 12, 6].

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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
  • A U B = A
  • A n C = ∅
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Using the attached tables, what would be the result of the following SQL query?

SELECT *

FROM student

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Using the attached tables, what would be the result of the following SQL query?

SELECT FirstName, LastName

FROM student

WHERE ModuleCode = ‘M269’

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a set?

A

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}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a set enumeration?

A

A set enumeration is when a set is written with all elements explicitly listed, for example, {3, 4, 5, 6, 7, 8}.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a set comprehension?

A

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}.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What would the set be for the following list of numbers:

5, 2, 8, 3, 5, 6, 2, 5, 9, 4, 6, 7

A

{2, 3, 4, 5, 6, 7, 8, 9}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What would be the set enumeration described by the following set comprehension:

{x : x is a whole number between 23 and 34}

A

{23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How would you write an empty set?

A

ø 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 ø.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What do the following expressions mean?

A
  • 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’
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What do the following expressions mean?

A
  • 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’
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does the following expression mean, when dealing with sets?

A = B

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What do the following expressions mean, and what would be the resulting sets?

A
  • 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’
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What do the following expressions mean, and what would be the resulting sets?

A
  • 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.
17
Q

What do the following expressions mean, and what would be the resulting sets?

A

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}
18
Q

What is a tuple?

A

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 ().

19
Q

What is the Cartesian product?

A

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’.

20
Q

What is the Cartesian product of the following two sets?

{1, 2} and {1, 3, 5}

A

{(1, 1), (1, 3), (1, 5), (2, 1), (2, 3), (2, 5)}

21
Q

What is a well-formed formula (WFF) of propositional logic?

A

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
  • (AB), where A and B are WFFs
  • (AB), where A and B are WFFs
  • (AB), where A and B are WFFs

Nothing else is a WFF.

22
Q

What is an interpretation of a set of WFFs?

A

An interpretation of a set of WFFs is an assignment of one of the truth values (TRUE or FALSE) to each of the variables.

23
Q

When is a WFF satisfiable?

A

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.

24
Q

What is a contradiction?

A

A contradiction is a formula which is FALSE in every possible interpretation.

25
Q

What is a tautology?

A

A tautology is a formula which is TRUE in every possible interpretation.

26
Q

When is a formula contingent?

A

A formula is contingent if it is TRUE in some possible interpretations and FALSE in others.

27
Q

When would two WFFs be logically equivalent, and how is this written?

A

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 A1A2.

28
Q

What is a valid argument?

A

An argument is valid only if there is no interpretation in which the premises are TRUE and the conclusion is FALSE.

29
Q

Is the following argument valid?

R ∧ S

¬R ∨ Q

S → Q

A

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.

30
Q

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

A

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.