Duration of the test: 1 hour 45 minutes.
Midterm I problems
If not precised otherwise, you can assume that the domain of all variables and predicates is the set
Problem 1 (15 points)
Are the following statements logically equivalent for all (binary) predicates
In second-order logic, which of the quantifiers
Problem 2 (10 points)
Is the following inference valid?
Problem 3 (15 points)
Consider the following statements:
Circle the number of the statements that are true for all sets
Problem 4 (15 points)
Let
Note: please be detailed with the proof. A Venn diagram is not sufficient argument: it is not rigorous reasoning.
Problem 5 (25 points)
Recall that
For non-zero integer numbers
Here
Compute the
Define
Below is a predicate logic proof (using some words for context!) of some statement. Write in English the statement that is being proved and the technique used. Determine if the proof is valid or invalid. If the proof is invalid, identify and explain the error(s) in the proof. Continue investigating even if erroneous claims have already been made: the goal is to find all logical mistakes in the steps.
Statement:
It is obvious that
But
This proves the original statement.
Problem 6 (20 points)
While creating a user interface for your website, you want to encourage the user to create secure passwords for their accounts. You decide to implement a password strength checker that verifies if a password meets the following criteria:
- The password must contain at least one letter.
- The password must contain exactly one special character from the set
, %, &, *}$. - The password must not contain any symbols other than letters, digits, and special characters specified above.
- No three elements of the password can be the same. Be careful :)
- Two neighboring elements of the password cannot be from the same set of characters: letters, digits, or special characters.
All passwords are assumed to be exactly
The task of this problem is to design a predicate
: is a letter. : is a digit. : is a special character.
For the domain of the predicate
-
Is the password “password” secure? What map
corresponds to this password? -
Is the password “P@ssw0rd” secure?
-
Write down in predicate logic the predicate
that checks validity of condition 1. -
Write down in predicate logic the predicate
that checks validity of condition 2. -
Write down in predicate logic the predicate
that checks validity of condition 3. -
Write down in predicate logic the predicate
that checks validity of condition 4. -
Write down in predicate logic the predicate
that checks validity of condition 5. -
Write down in predicate logic the predicate
in terms of the predicates , , , and . Try to be as concise as possible.