Free Practice Quiz Question List

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.

20 questions
01
Choose one
1 point

Consider the implication: “If a file is encrypted, then unauthorized users cannot read it.” In which situation is this implication false?

  1. A

    The file is not encrypted, and unauthorized users cannot read it.

  2. B

    The file is encrypted, and unauthorized users can read it.

  3. C

    The file is not encrypted, and unauthorized users can read it.

  4. D

    The file is encrypted, and unauthorized users cannot read it.

02
Choose one
1 point

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?

  1. A

    F is not encrypted.

  2. B

    Unauthorized users can read F.

  3. C

    Unauthorized users cannot read F.

  4. D

    F is readable by everyone.

03
Choose one
1 point

Let A = {1, 2, 3}, B = {3, 4}, and C = {2, 4, 6}. What is (A ∪ B) ∩ C?

  1. A

    {1}

  2. B

    {2, 3}

  3. C

    {2, 4}

  4. D

    {1, 2, 3, 4, 6}

04
Written response
1 point

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”?

05
Written response
1 point

A set A has exactly 4 elements. What is the number of elements in its power set 𝒫(A)?

06
Fill in the blank
1 point

Complete the two blanks: The negation of “for every x, P(x)” is “.” Therefore, “not every input is valid” means “.”

07
Choose one
1 point

For f: ℤ → ℤ defined by f(n) = n + 1, which classification is correct?

  1. A

    f is bijective.

  2. B

    f is injective but not surjective.

  3. C

    f is surjective but not injective.

  4. D

    f is neither injective nor surjective.

08
Choose all
1 point

Select all properties that a relation must have to be an equivalence relation on a set.

  1. A

    For every a, aRa.

  2. B

    If aRb, then bRa.

  3. C

    If aRb and bRa, then a = b.

  4. D

    If aRb and bRc, then aRc.

09
True or false
1 point

The function g: ℤ → ℤ defined by g(n) = n² is neither injective nor surjective.

  1. A

    True

  2. B

    False

10
Choose all
1 point

Select all steps or assumptions that belong to a standard proof by mathematical induction.

  1. A

    Prove the statement for the first required value, such as 0.

  2. B

    Assume the statement for an arbitrary k in the domain.

  3. C

    Use the assumption to prove the statement for k + 1.

  4. D

    Assume the statement is already true for every natural number.

11
Fill in the blank
1 point

Let f(x) = x + 2 and g(x) = 2x + 1. Complete the calculation: (g ∘ f)(3) = .

12
Choose one
1 point

Which statement is a counterexample-based disproof of the claim “Every prime number is odd”?

  1. A

    Every prime number greater than 2 is odd.

  2. B

    2 is prime but not odd.

  3. C

    Every even number is prime.

  4. D

    Every odd number is prime.

13
Open ended
1 point

Prove the set identity A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) using the method of proving both inclusions.

14
Choose one
1 point

Under which assignment of truth values is the implication P → Q false?

  1. A

    P is false and Q is true.

  2. B

    P is true and Q is false.

  3. C

    P is false and Q is false.

  4. D

    P is true and Q is true.

15
True or false
1 point

True or false: The statement “Not every input is valid” is logically equivalent to “There exists an invalid input.”

  1. A

    True

  2. B

    False

16
Written response
1 point

Let A = {1, 2, 3} and B = {x, y}. What is the cardinality of A × B? Enter the exact whole-number value.

17
Choose one
1 point

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?

  1. A

    ∃p ∀u Has(u,p)

  2. B

    ∀p ∃u Has(u,p)

  3. C

    ∀u ∃p Has(u,p)

  4. D

    ∃u ∀p Has(u,p)

18
Choose one
1 point

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?

  1. A

    It is only reflexive.

  2. B

    It is a partial order but not an equivalence relation.

  3. C

    It is symmetric and transitive but not reflexive.

  4. D

    It is an equivalence relation.

19
Written response
1 point

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.

20
True or false
1 point

True or false: To prove that an implication P → Q is valid, it is logically sufficient to prove its contrapositive ¬Q → ¬P.

  1. A

    True

  2. B

    False