Consider the implication: “If a file is encrypted, then unauthorized users cannot read it.” In which situation is this implication false?
08 — Discrete Mathematics for Computer Science Online Quiz Questions
Use this free practice quiz with 20 questions to review 08 — Discrete Mathematics for Computer Science, test your knowledge, and prepare for your next test or exam.
Suppose the following premises are true: “If file F is encrypted, unauthorized users cannot read F” and “File F is encrypted.” What conclusion follows by modus ponens?
- A
F is not encrypted.
- B
Unauthorized users can read F.
- C
Unauthorized users cannot read F.
- D
F is readable by everyone.
Let A = {1, 2, 3}, B = {3, 4}, and C = {2, 4, 6}. What is (A ∪ B) ∩ C?
- A
{1}
- B
{2, 3}
- C
{2, 4}
- D
{1, 2, 3, 4, 6}
In the implication “If a program state is valid, then the next state satisfies the invariant,” what is the logical term for the condition “a program state is valid”?
A set A has exactly 4 elements. What is the number of elements in its power set 𝒫(A)?
Complete the two blanks: The negation of “for every x, P(x)” is “.” Therefore, “not every input is valid” means “.”
For f: ℤ → ℤ defined by f(n) = n + 1, which classification is correct?
- A
f is bijective.
- B
f is injective but not surjective.
- C
f is surjective but not injective.
- D
f is neither injective nor surjective.
Select all properties that a relation must have to be an equivalence relation on a set.
- A
For every a, aRa.
- B
If aRb, then bRa.
- C
If aRb and bRa, then a = b.
- D
If aRb and bRc, then aRc.
The function g: ℤ → ℤ defined by g(n) = n² is neither injective nor surjective.
- A
True
- B
False
Select all steps or assumptions that belong to a standard proof by mathematical induction.
- A
Prove the statement for the first required value, such as 0.
- B
Assume the statement for an arbitrary k in the domain.
- C
Use the assumption to prove the statement for k + 1.
- D
Assume the statement is already true for every natural number.
Let f(x) = x + 2 and g(x) = 2x + 1. Complete the calculation: (g ∘ f)(3) = .
Which statement is a counterexample-based disproof of the claim “Every prime number is odd”?
- A
Every prime number greater than 2 is odd.
- B
2 is prime but not odd.
- C
Every even number is prime.
- D
Every odd number is prime.
Prove the set identity A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) using the method of proving both inclusions.
Under which assignment of truth values is the implication P → Q false?
- A
P is false and Q is true.
- B
P is true and Q is false.
- C
P is false and Q is false.
- D
P is true and Q is true.
True or false: The statement “Not every input is valid” is logically equivalent to “There exists an invalid input.”
- A
True
- B
False
Let A = {1, 2, 3} and B = {x, y}. What is the cardinality of A × B? Enter the exact whole-number value.
Which formula expresses the statement “Every user has at least one password,” where u ranges over users, p ranges over passwords, and Has(u,p) means that user u has password p?
- A
∃p ∀u Has(u,p)
- B
∀p ∃u Has(u,p)
- C
∀u ∃p Has(u,p)
- D
∃u ∀p Has(u,p)
On the integers, define a relation by a R b if and only if a and b have the same remainder when divided by 3. How should this relation be classified?
- A
It is only reflexive.
- B
It is a partial order but not an equivalence relation.
- C
It is symmetric and transitive but not reflexive.
- D
It is an equivalence relation.
What is the standard name of the rule of inference that derives ¬P from the premises ¬Q and P → Q? Enter the rule's standard name.
True or false: To prove that an implication P → Q is valid, it is logically sufficient to prove its contrapositive ¬Q → ¬P.
- A
True
- B
False
Related study packs and tools
2 Digital Logic
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
6 Computer Memory
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
6 Trees and Binary Search Trees
A 14-question quiz on trees, binary trees, traversals, recursive algorithms, and binary search trees. The questions progress from foundational concepts to applied reasoning about structure, complexity, and BST operations.
07 Trees and Binary Search Trees
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
8 Software Documentation
Learn how to choose, structure, document, and maintain software documentation for users, developers, integrators, and operators.
9 Sorting Algorithms
A structured guide to comparison-based sorting algorithms, their complexity, stability, memory use, and practical selection criteria.
Interrupts
Reviews how interrupts support event handling and multitasking, and how Linux system calls use the RISC-V `ecall` instruction and register conventions.
OS Processes
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.
Systemcalls
A quiz on operating-system system calls, including privileged-operation requests, process creation and execution with fork, exec, and waitpid, and signal handling.