CS Finals (SW ed.) Flashcards
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.
False
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.
False
Evaluate: True AND False
False
Evaluate: NOT False AND NOT False
True
If p is true and q is false, what is the truth value of the expression p → q?
False
Which of the following is an example of a compound proposition?
Show answer choices
q
not p
p and q
p
p and q
What is a compound Proposition?
statement that combines 2 or more propositions using connectives (and, or, but)
What does the logical operator ‘¬’ represent?
Show answer choices
Conjunction
Disjunction
Implication
Negation
Negation
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 statement that is either true or false.
Which of the following is NOT a logical constant?
Show answer choices
X
1
True
False
X
What is a logical constant
a symbol that has the same meaning no matter what
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.
Checking all possible cases to see if the proposition holds true.
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.
To determine the truth values of propositions under different scenarios.
In propositional logic, what does the symbol ‘→’ signify?
Show answer choices
Conjunction, meaning ‘and’.
Negation, meaning ‘not’.
Disjunction, meaning ‘or’.
Implication, meaning ‘if… then…’
Implication, meaning ‘if… then…’
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.
That if the premise is true, then the conclusion must also be true.
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.
That the proposition you want to prove is false.
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.
Both sides must have the same truth value.
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.
Proof by contradiction that involves guessing.
In the expression p ∨ q, what does the ‘∨’ operator represent?
Show answer choices
Logical OR
Logical AND
Logical NOT
Logical implication
Logical OR
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.
Both statements must be true.
Which logical operator indicates that at least one of the statements is true?
Show answer choices
Logical AND (∧)
Logical OR (∨)
Implication (→)
Negation (¬)
Logical OR (∨)
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 biconditional statement.
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.
The simplest instance where the proposition fails to hold.
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.
Mathematical induction.
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
43
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
67
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
67
34
75
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
21
32
43
22
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, …}
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, …}
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
0
7
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
equipment
;seotu;wjrecrunse;uc;fuodfjodsslkfe’
mahiwagang salamin kailan ba nya aaminin kanyang tunay na pagtingin
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
2937234983243
2047834791
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
67
43
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
-2
5
6
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
-32
2.3
3124
3
0
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
11
12
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.
Lists can construct over existing lists to create new lists while tuples cannot.
This is the singular elements that can be used to construct a string.
Hide answer choices
Alphabet
Lemma
Language
Lambda
Alphabet
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 language is a set of strings.
Alphabets are a set of elements that can form a string.
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
concatenation
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>
<g, s>
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)
(m, e, o, w) = (m, e, o, w)
(a, b, c) = (a, b, c)
Empty lists do not have heads or tails.
T
True
FALSE
True
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
mailaoiiioiiiooiiioooiiioo
ilaoilaoilaoilaoilao
llaollaollao
lmailoamilaiamilailamialomailm
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)
(0, 6)
(4, 9)
This is the singular elements that can be used to construct a string.
Lambda
Language
Lemma
Alphabet
Alphabet
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»
«g, w, e, n>, s, t, a, c, e, y>
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
Λ
decaftea
fadedtear
bead
Λ
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
mewmewmewmew
meowmeowmeowmeow
emowemowemowemwoemwemweowem
A function can have more than one output for a single input.
T
F
F
Every function is a relation, but not every relation is a function.
T
True
F
False
T
What is the output of the function f(x) = x + 3 when x is 2?
Show answer choices
5
3
4
2
5
The domain of a function is the set of all possible inputs.
T
True
F
False
T
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
F
If f(x) = x^2, what is f(4)?
Show answer choices
16
12
4
8
16
In a function, each input must have exactly one __________
output.
The range of a function includes all possible outputs.
T
True
F
False
T
What is domain
All possible input in a function
What is range
All possible outputs from a function
What is input
The Value you put into the function
What is output
The result you get from the function
A function can be represented by a table, a graph, or an equation.
T
True
F
False
T
Which of the following represents a function?
Show answer choices
f(x) = 2x
y^2 = x
x = 5
x + y = 5
f(x) = 2x
In modular arithmetic, what is 10 mod 4?
Show answer choices
0
2
1
2
Public-key Cryptography
Uses pairs of keys, one public and one private
Hash Function
Transforms input data into a fixed size string of characters.
Encryption
The process of converting plaintext into ciphertext.
Decryption
The process of converting ciphertext back into plaintext.
The first prime number is ____.
2
Prime Number
A number greater than 1 that has no positive divisors other than 1 and itself.
Modular Arithmetic
Arithmetic that deals with remainders after division by a specific number.
Caesar Cipher
A method of encryption that shifts letters by a fixed number.
Substitution Cipher
A method of encryption where each letter is replaced by a different letter.
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
To create a fixed-size output from input data
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
Easily broken through frequency analysis
Which of the following operations is used in a Caesar cipher?
Show answer choices
Rotate
Invert
Shift
Swap
Shift
Modular arithmetic can be used to find remainders after division.
T
True
F
False
True
In modular arithmetic, adding numbers wraps around after reaching a certain _____________
value(notsure)
Modulus
All prime numbers are odd numbers.
T
True
F
False
F
Which cipher is considered a symmetric cipher?
Show answer choices
RSA
Substitution Cipher
Caesar Cipher
Diffie-Hellman
Caesar Cipher
Which of the following numbers is a prime number?
Show answer choices
10
13
6
4
13
1
Caesar Cipher
A simple shift cipher.
Transposition Cipher
Rearranges the characters in the plaintext.
Block Cipher
Encrypts data in fixed-size blocks.
4
Stream Cipher
Encrypts data one bit or byte at a time.
What is the result of 7 mod 3?
Show answer choices
1
2
3
0
1
Frequency analysis is a technique used to break substitution ciphers.
T
True
F
False
T
A Caesar cipher encrypts data by rearranging the order of letters.
T
True
F
False
F
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
To encrypt data that only the corresponding private key can decrypt
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
The process of converting plaintext into ciphertext
Which cipher is considered the simplest form of encryption?
Show answer choices
Diffie-Hellman
AES
RSA
Caesar cipher
Caesar cipher
A hash function can produce the same output for different inputs. (True/False)
T
True
F
False
False
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
The remainder after division of one number by another
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
By replacing each letter with another letter
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
It has exactly two distinct positive divisors: 1 and itself
Which property is essential for a function to be considered a hash function?
Show answer choices
Linearity
Randomness
Reversibility
Determinism
Determinism
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
It analyzes the frequency of letters or groups of letters to decipher encryption
SHA-256 is widely used because it produces a secure fixed-size __________
Hash
Binomial Theorem
formula that describes the algebraic expansion of powers of a binomial.
Permutations consider the order of items.
T
True
F
False
T
Binomial Coefficient
Counts ways to choose k elements from n.
permutation formula
n!/(n-r)!
Combination formula
n!/r!(n-r)!
A set with one element is called a
singleton
An example that proves a statement false is often called a
counterexample
direct approach to proving a conditional of the form “if A then B” starts with the assumption that the antecedent ______________
A is true.
is a false statement
contradiction
starts out by assuming that the statement to be proved is
false
proof by contradiction
another name for proof by contradiction
indirect proof