CS Finals (SW ed.) Flashcards

1
Q

Given the following statements:

Statement A: When 4x+2 = 0, x is 0.5.

Statement B: 20 is a prime number.

Statement C: A and B are true.

Identify the truth value of Statement C.

A

False

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

Statement A: 5 + 23 is 28.

Statement B: 31 - 2 is 33.

Statement C: A or B is not true.

Identify the truth value of Statement C.

A

False

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

Evaluate: True AND False

A

False

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

Evaluate: NOT False AND NOT False

A

True

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

If p is true and q is false, what is the truth value of the expression p → q?

A

False

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

Which of the following is an example of a compound proposition?

Show answer choices

q

not p

p and q

p

A

p and q

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

What is a compound Proposition?

A

statement that combines 2 or more propositions using connectives (and, or, but)

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

What does the logical operator ‘¬’ represent?

Show answer choices

Conjunction

Disjunction

Implication

Negation

A

Negation

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

What is the definition of a proposition in logic?

Show answer choices

A statement that is either true or false.

A sentence that can be either a statement or a question.

A command or question.

An assumption that is not verified.

A

A statement that is either true or false.

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

Which of the following is NOT a logical constant?

Show answer choices

X

1

True

False

A

X

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

What is a logical constant

A

a symbol that has the same meaning no matter what

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

hat does proof by exhaustive checking involve?

Show answer choices

Using a single example to prove the statement is true.

Assuming the proposition is true and finding a counterexample.

A method of proof that is never conclusive.

Checking all possible cases to see if the proposition holds true.

A

Checking all possible cases to see if the proposition holds true.

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

What is the truth table used for?

Show answer choices

To define the syntax of logical expressions.

To simplify complex propositions.

To determine the truth values of propositions under different scenarios.

To create logical conclusions.

A

To determine the truth values of propositions under different scenarios.

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

In propositional logic, what does the symbol ‘→’ signify?

Show answer choices

Conjunction, meaning ‘and’.

Negation, meaning ‘not’.

Disjunction, meaning ‘or’.

Implication, meaning ‘if… then…’

A

Implication, meaning ‘if… then…’

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

In conditional proof, what must be demonstrated?

Show answer choices

A counterexample to the premise.

That if the premise is true, then the conclusion must also be true.

That both the premise and conclusion are true.

That the conclusion can be true regardless of the premise.

A

That if the premise is true, then the conclusion must also be true.

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

When constructing a proof by contradiction, what must you assume initially?

Show answer choices

That all premises are valid.

That no conclusions can be drawn.

That the proposition is true.

That the proposition you want to prove is false.

A

That the proposition you want to prove is false.

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

Which of the following statements best defines ‘if and only if’ (↔)?

Show answer choices

It is a condition that relies solely on the first statement.

Either one can be true for the statement to hold.

Both sides must have the same truth value.

The first must be true for the second to be true, but not vice versa.

A

Both sides must have the same truth value.

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

Which of the following is NOT a valid method of proof?

Show answer choices

Direct proof.

Proof by contradiction.

Proof by contradiction that involves guessing.

Constructive proof.

A

Proof by contradiction that involves guessing.

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

In the expression p ∨ q, what does the ‘∨’ operator represent?

Show answer choices

Logical OR

Logical AND

Logical NOT

Logical implication

A

Logical OR

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

Question 15
1
/
1
What does the conjunction operator ‘∧’ indicate?

Show answer choices

Both statements must be false.

At least one statement is true.

One statement implies the other.

Both statements must be true.

A

Both statements must be true.

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

Which logical operator indicates that at least one of the statements is true?

Show answer choices

Logical AND (∧)

Logical OR (∨)

Implication (→)

Negation (¬)

A

Logical OR (∨)

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

What do we call the situation where ‘p’ implies ‘q’ and ‘q’ implies ‘p’?

Show answer choices

A biconditional statement.

An implication.

A tautology.

A disjunction.

A

A biconditional statement.

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

What is a minimal counterexample?

Show answer choices

An example that has multiple variables.

The simplest instance where the proposition fails to hold.

An example that supports the proposition.

The most complex example that invalidates the proposition.

A

The simplest instance where the proposition fails to hold.

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

Which method would you use to prove a proposition that claims something is true for all integers?

Show answer choices

Using a single counterexample.

Mathematical induction.

Direct computation of values.

Exhaustive checking of all integers up to a specified number.

A

Mathematical induction.

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

Let A = {34, 67, 21, 94, 43};

Let B = {22, 21, 14, 19, 67};

Let C = {94, 67, 34, 32, 22};

And A∈U, B∈U C∈U.

Which of the following elements belong to B’\C? Select all that apply. Partial points are awarded.

Show answer choices

94

67

43

21

32

A

43

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

Question 3
5
/
5
Let A = {34, 67, 21, 94, 22};

Let B = {22, 42, 14, 19, 67};

Let C = {92, 21, 34, 32, 22};

And A∈U, B∈U C∈U.

Which of the following elements belong to (C’∪B)? Select all that apply. Partial points are awarded.

Show answer choices

21

67

92

34

22

A

67

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

Question 4
5
/
5
Let A = {34, 67, 21, 94, 22};

Let B = {22, 75, 14, 86, 67};

Let C = {32, 79, 94, 75, 22};

And A∈U, B∈U C∈U.

Which of the following elements belong to (A∩C)’? Select all that apply. Partial points are awarded.

Show answer choices

67

34

94

75

22

A

67

34
75

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

Question 5
5
/
5
Let A = {34, 67, 21, 94, 43};

Let B = {22, 21, 14, 19, 67};

Let C = {94, 67, 34, 32, 22};

And A∈U, B∈U C∈U.

Which of the following elements belong to AΔC? Select all that apply. Partial points are awarded.

Show answer choices

21

64

32

43

22

A

21

32

43

22

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

Question 1
0
/
5
Which of the following is considered a set? Select all that apply. Partial points will not be provided.

Show answer choices

J = {all natural even numbers that are less than 25 but greater than 26}

G = {apple, banana, orange, melon, banana}

Y = { x^2 | x ∈ N }

A = {5, 2, 8768, 1}

O = {1, 2, 3, 5, 8, 13, …}

A

J = {all natural even numbers that are less than 25 but greater than 26}

Y = { x^2 | x ∈ N }

A = {5, 2, 8768, 1}

O = {1, 2, 3, 5, 8, 13, …}

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

Consider this set statement:

A space equals space left curly bracket space 12 space comma space 5 space comma space 3 space comma space minus 2 space right curly bracket
B space equals space left curly bracket space x plus 2 space vertical line space space x element of A space right curly bracket
C space equals space left curly bracket space y minus 7 space vertical line space space y element of B space right curly bracket

Which of the following is a member of C? Select ALL that apply. Partial points are NOT awarded.

Hide answer choices

0

5

7

-9

1

A

0
7

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

Consider this set statement:

F equals left curly bracket space a l l space s t r i n g s space t h a t space e n d space w i t h space apostrophe e apostrophe space right curly bracket
U equals left curly bracket a l l space s t r i n g s right curly bracket

Which of the following elements is a member of F’? Select ALL that apply. Partial points are NOT provided.

Hide answer choices

eeeeeeeeeeeeeeeeeeeeeee

equipment

;seotu;wjrecrunse;uc;fuodfjodsslkfe’

mahiwagang salamin kailan ba nya aaminin kanyang tunay na pagtingin

adorable

A

equipment

;seotu;wjrecrunse;uc;fuodfjodsslkfe’

mahiwagang salamin kailan ba nya aaminin kanyang tunay na pagtingin

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

Consider this set statement:

D equals left curly bracket space x plus 1 space vertical line space x element of natural numbers semicolon space x vertical ellipsis 2 right curly bracket

Which of the following is a member of the said set? Select ALL that apply. Partial points are awarded.

Partial and negative credit
Points may have been deducted for incorrect answers.
Hide answer choices

-1126298745

2937234983243

29374983572758

0

2047834791

A

2937234983243
2047834791

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

Consider the following set statement:

H space equals space left curly bracket 1 comma space 3 comma space 5 comma space 7 comma space 11 comma space 13 comma space 17 comma space 19 comma space 23 comma space… right curly bracket

Which of the following is an element of the given set? Select ALL that apply. Partial points are NOT awarded.

Hide answer choices

28

67

43

A

67
43

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

Consider this set statement:

A space equals space left curly bracket space 12 space comma space 5 space comma space 3 space comma space minus 2 space right curly bracket
B space equals space left curly bracket space x plus 2 space vertical line space space x element of A space right curly bracket
C space equals space left curly bracket space y minus 7 space vertical line space space y element of B space right curly bracket

Which of the following is not a member of B∩C? Select ALL that apply. Partial points are NOT awarded.

Hide answer choices

-2

5

0

7

6

A

-2

5

6

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

Question 6
3
/
5
Consider this set statement:

G space equals space left curly bracket space x plus y space vertical line space space x space less than space 5 semicolon space x element of straight integer numbers semicolon space y element of straight real numbers space right curly bracket

Which of the following is a member of the given set above? Select ALL that apply. Partial points are awarded.

Partial and negative credit
Points may have been deducted for incorrect answers.
Hide answer choices

-32

2.3

3124

3

0

A

-32

2.3

3124

3

0

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

Assume the following statements:

A equals left curly bracket space 67 space comma space 18 space comma space 28 space comma space 21 space right curly bracket
B equals left curly bracket space 12 space comma space 9 space comma space 11 space comma space 18 space right curly bracket
C equals left curly bracket space 23 space comma space 28 space comma space 67 space comma space 1 space right curly bracket
U equals left curly bracket space e l e m e n t s space i n space A comma space B comma space a n d space C space right curly bracket

Which of the following are not a member of (A∪C)? Select ALL that apply. Partial points will be provided.

Hide answer choices

18

11

1

67

12

A

11
12

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

Which of the following is the difference between Tuples and Lists?

Hide answer choices

Tuples can only access two things at a time while lists can access any element anytime.

Lists can construct over existing lists to create new lists while tuples cannot.

Tuples can have multiple sub-tuples inside it while lists have several bubbles that could be rendered as a set.

Lists can be represented in a computer while tuples are offered in a more practical and real-world scenario.

A

Lists can construct over existing lists to create new lists while tuples cannot.

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

This is the singular elements that can be used to construct a string.

Hide answer choices

Alphabet

Lemma

Language

Lambda

A

Alphabet

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

Which of the following statements about strings, languages, and alphabets are true? Select all that apply. Partial points are awarded.

Hide answer choices

A language is a set of strings.

Alphabets are a set of elements that can form a string.

Strings are a set of alphabets.

A

A language is a set of strings.

Alphabets are a set of elements that can form a string.

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

This is the operation where two strings are placed next to each other to form a new string.

Hide answer choices

contempolation

contradiction

construction

concatenation

A

concatenation

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

A space equals space less than g comma space w comma space e comma space n greater than
B space equals space less than s comma space t comma space a comma space c comma space e comma space y greater than

What is cons(head(A), head(B)) ?

Hide answer choices

<n, y>

<g, s>

<g, t>

<w, e, n, t, a, c, e, y>

A

<g, s>

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

Which of the following is considered two equal tuples? Select all that apply. Partial points are awarded.

Hide answer choices

(t, o, o, t) = (o, t, t, o)

(m, e, o, w) = (m, e, o, w)

(a, b, c) = (a, b, c)

(R, O, O, M) = (R, 0, O, M)

A

(m, e, o, w) = (m, e, o, w)

(a, b, c) = (a, b, c)

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

Empty lists do not have heads or tails.

T

True

FALSE

A

True

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

Given the following alphabet:

B space equals space left curly bracket m comma space a comma space l comma space o comma space i right curly bracket

Which of the following is a string over B? Select all that apply. Partial points are awarded.

Hide answer choices

mailaoiiioiiiooiiioooiiioo

ilaoilaoilaoilaoilao

llaollaollao

lmailoamilaiamilailamialomailm

mmlamiliml1ailaoilamiloa

A

mailaoiiioiiiooiiioooiiioo

ilaoilaoilaoilaoilao

llaollaollao

lmailoamilaiamilailamialomailm

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

Given the sets below, which of the following is a member of A x B? Select all that apply. Partial points are awarded.

A space equals space left curly bracket 4 comma space 2 comma space 0 right curly bracket
B space equals space left curly bracket 6 comma space 9 right curly bracket
A space cross times space B space equals space left curly bracket space left parenthesis a comma space b right parenthesis space vertical line space a element of A semicolon space b element of B right curly bracket

Hide answer choices

{4, 6}

(0, 6)

(4, 9)

(9, 0)

(6, 2)

A

(0, 6)

(4, 9)

46
Q

This is the singular elements that can be used to construct a string.

Lambda

Language

Lemma

Alphabet

47
Q

Consider the following lists:

A space equals space less than g comma space w comma space e comma space n greater than
B space equals space less than s comma space t comma space a comma space c comma space e comma space y greater than

What is cons(A,B) ?

<g, w, e, n, <s, t, a, c, e, y»

«g, w, e, n>, s, t, a, c, e, y>

<g, w, e, n, s, t, a, c, e, y>

«g, w, e, n>, <s, t, a, c, e, y»

A

«g, w, e, n>, s, t, a, c, e, y>

48
Q

Given the following alphabets:

A space equals space left curly bracket a comma space b comma space c comma space d comma space e comma space f right curly bracket
B space equals space left curly bracket g comma space r comma space e comma space a comma space t right curly bracket

And assume C is a string over A and D is a string over B.

Which of the following strings would be valid when C and D are concatenated as CD? Select all that apply. Partial points are not awarded.

Hide answer choices

decaftea

fadedtear

greatface

bead

Λ

A

decaftea

fadedtear

bead

Λ

49
Q

Given the following alphabet:

E space equals space left curly bracket m comma space e comma space o comma space w right curly bracket

Which of the following is a string over E? Select all apply. Partial points are not awarded.

Hide answer choices

meomeowmeowmewoemwneowenw

mewmewmewmew

meowmeowmeowmeow

pspspspspsps

emowemowemowemwoemwemweowem

A

mewmewmewmew

meowmeowmeowmeow

emowemowemowemwoemwemweowem

51
Q

A function can have more than one output for a single input.

T

F

52
Q

Every function is a relation, but not every relation is a function.

T

True
F

False

53
Q

What is the output of the function f(x) = x + 3 when x is 2?

Show answer choices

5

3

4

2

54
Q

The domain of a function is the set of all possible inputs.

T

True
F

False

55
Q

If a function has an output of -2 for an input of 3, it can also have an output of 3 for the same input.

T

True
F

False

56
Q

If f(x) = x^2, what is f(4)?

Show answer choices

16

12

4

8

57
Q

In a function, each input must have exactly one __________

58
Q

The range of a function includes all possible outputs.

T

True
F

False

59
Q

What is domain

A

All possible input in a function

60
Q

What is range

A

All possible outputs from a function

61
Q

What is input

A

The Value you put into the function

62
Q

What is output

A

The result you get from the function

63
Q

A function can be represented by a table, a graph, or an equation.

T

True
F

False

64
Q

Which of the following represents a function?

Show answer choices

f(x) = 2x

y^2 = x

x = 5

x + y = 5

65
Q

In modular arithmetic, what is 10 mod 4?

Show answer choices

0

2

1

66
Q

Public-key Cryptography

A

Uses pairs of keys, one public and one private

67
Q

Hash Function

A

Transforms input data into a fixed size string of characters.

68
Q

Encryption

A

The process of converting plaintext into ciphertext.

69
Q

Decryption

A

The process of converting ciphertext back into plaintext.

70
Q

The first prime number is ____.

71
Q

Prime Number

A

A number greater than 1 that has no positive divisors other than 1 and itself.

72
Q

Modular Arithmetic

A

Arithmetic that deals with remainders after division by a specific number.

73
Q

Caesar Cipher

A

A method of encryption that shifts letters by a fixed number.

74
Q

Substitution Cipher

A

A method of encryption where each letter is replaced by a different letter.

75
Q

What is the main purpose of a hash function in cryptography?

Show answer choices

To create a fixed-size output from input data

To encrypt data

To decrypt data

To generate prime numbers

A

To create a fixed-size output from input data

76
Q

What is one of the main weaknesses of a Caesar cipher?

Show answer choices

Easily broken through frequency analysis

Cannot be used for encryption

Requires large keys

Only works with numbers

A

Easily broken through frequency analysis

77
Q

Which of the following operations is used in a Caesar cipher?

Show answer choices

Rotate

Invert

Shift

Swap

78
Q

Modular arithmetic can be used to find remainders after division.

T

True
F

False

79
Q

In modular arithmetic, adding numbers wraps around after reaching a certain _____________

A

value(notsure)
Modulus

80
Q

All prime numbers are odd numbers.

T

True
F

False

81
Q

Which cipher is considered a symmetric cipher?

Show answer choices

RSA

Substitution Cipher

Caesar Cipher

Diffie-Hellman

A

Caesar Cipher

82
Q

Which of the following numbers is a prime number?

Show answer choices

10

13

6

4

83
Q

1
Caesar Cipher

A

A simple shift cipher.

84
Q

Transposition Cipher

A

Rearranges the characters in the plaintext.

85
Q

Block Cipher

A

Encrypts data in fixed-size blocks.

86
Q

4
Stream Cipher

A

Encrypts data one bit or byte at a time.

87
Q

What is the result of 7 mod 3?

Show answer choices

1

2

3

0

88
Q

Frequency analysis is a technique used to break substitution ciphers.

T

True
F

False

89
Q

A Caesar cipher encrypts data by rearranging the order of letters.

T

True
F

False

90
Q

What is the primary purpose of a public key in cryptography?

Show answer choices

To sign messages for authenticity

To ensure data integrity without encryption

To encrypt data that only the corresponding private key can decrypt

To determine the hash of data

A

To encrypt data that only the corresponding private key can decrypt

91
Q

In cryptography, what does the term ‘encryption’ specifically refer to?

Show answer choices

The process of converting plaintext into ciphertext

The reverse process of decryption

The generation of keys

The act of hashing data

A

The process of converting plaintext into ciphertext

92
Q

Which cipher is considered the simplest form of encryption?

Show answer choices

Diffie-Hellman

AES

RSA

Caesar cipher

A

Caesar cipher

93
Q

A hash function can produce the same output for different inputs. (True/False)

T

True
F

False

94
Q

In context to number theory, what does the term modulo refer to?

Show answer choices

The remainder after division of one number by another

The product of two numbers

The total count of prime numbers

The sum of digits in a number

A

The remainder after division of one number by another

95
Q

In a substitution cipher, how is data transformed?

Show answer choices

By replacing each letter with another letter

By rearranging letters

By converting letters to numbers

By shifting all letters by a fixed amount

A

By replacing each letter with another letter

96
Q

Which of the following is a characteristic of a prime number?

Show answer choices

It is an even number

It has an infinite number of factors

It has exactly two distinct positive divisors: 1 and itself

It is divisible by at least one other number

A

It has exactly two distinct positive divisors: 1 and itself

97
Q

Which property is essential for a function to be considered a hash function?

Show answer choices

Linearity

Randomness

Reversibility

Determinism

A

Determinism

98
Q

Why is frequency analysis effective against simple ciphers?

Show answer choices

It uses brute force to try every possible code

It analyzes the frequency of letters or groups of letters to decipher encryption

It changes the keys used in encryption

It relies on prime numbers to break encryption

A

It analyzes the frequency of letters or groups of letters to decipher encryption

99
Q

SHA-256 is widely used because it produces a secure fixed-size __________

100
Q

Binomial Theorem

A

formula that describes the algebraic expansion of powers of a binomial.

101
Q

Permutations consider the order of items.

T
True
F
False

102
Q

Binomial Coefficient

A

Counts ways to choose k elements from n.

103
Q

permutation formula

104
Q

Combination formula

A

n!/r!(n-r)!

105
Q

A set with one element is called a

106
Q

An example that proves a statement false is often called a

A

counterexample

107
Q

direct approach to proving a conditional of the form “if A then B” starts with the assumption that the antecedent ______________

A

A is true.

108
Q

is a false statement

A

contradiction

109
Q

starts out by assuming that the statement to be proved is
false

A

proof by contradiction

110
Q

another name for proof by contradiction

A

indirect proof