How to submit:

  • Submit before actual tutorial time for it to be graded. There are 2 ways to do this:
    1. There is a submission box on Canvas for you to submit your document. Either .docx, .pdf, or a picture of your written solutions are acceptable as long as we can read your attempts.
    2. Submit your written attempts in-person during our tutorial.
  • Official due date for submission : 11-Feb-2025, 6:30PM

Collaboration Policy:

  • You may discuss high-level ideas with your classmates or friends. You should list your collaborators if you do so.
  • Do not share your solutions.
  • ChatGPT (and other LLMs) are not allowed.
  • Your submission must be of your own write-up.

Late Policy:

  • < 1 week after submission deadline: 50% penalty
  • < 2 weeks after submission deadline: 75% penalty
  • No submissions after 2 weeks.

Overview

This tutorial gives practice questions to be discussed during the relevant tutorial in person. This particular tutorial sheet corresponds to Unit 1. It is recommended to either watch the lectures or read the notes for each respective parts before attempting the tutorial sheet.

  1. Questions 1 through 3 are related to propositional logic.
  2. Questions 4 through 6 are related to first order logic.
  3. Questions 7 and 8 are related to proofs.

After week 2’s content, you should be able to attempt questions 1 through 6. Questions 2, and 4 are graded for participation.

After week 4’s content, you should be able to attempt questions 7 and 8. Question 7 is graded for participation.

That said, we encourage you to try all the questions, this way when you come for tutorial we can best make use of your time since you can either verify your solutions, or understand the discussions when our tutors go through the solutions.

Question 1:

Purpose

Practice translating English sentences into propositional formulae!

For each of the following, write a propositional formula that accurately represents the given English statement. Use the propositions , , , and as needed, where they’re defined as:

  • : “The program compiles.”
  • : “The input is valid.”
  • : “The output is correct.”
  • : “The function is efficient.”
  • : “The algorithm terminates.”
  1. “If the input is valid, then the output is correct”

  2. “If the program compiles but the input is not valid, then the output is not correct.”

  3. “The function is efficient if and only if (both the algorithm terminates and the output is correct).” (Hint: “if and only if” means an implication in both directions. if and only if is the same as )

  4. “((The program compiles and the input is valid) or the function is efficient), and the algorithm does not terminate.”

  5. “If the program compiles, then ((either the input is valid and the output is correct), or the algorithm does not terminate).”

  6. “The function is efficient if and only if ((the program compiles and the input is valid), or (if the output is correct implies that the algorithm terminates)).”

Example: The answer to point 0. is: "".


Question 2: Negating Propositional Formulae [Graded Participation]

To do this question, make sure you have read the section on logical equivalences. In that section, we showed that is logically equivalent to . In this tutorial question, we will look at now the negation connective works in the other cases.

Part A: Equivalences

Draw two truth tables to verify that:

  1. is logically equivalent to .
  2. is logically equivalent to .

Key takeaway from this tutorial question and the notes:

  1. is logically equivalent to
  2. is logically equivalent to
  3. is logically equivalent to (From the notes)
  4. is logically equivalent to (From the notes)

Sneak peek: These negations are super useful because later on when we talk about considering proof by contradictions knowing how to negate statements comes in handy. (Relevant content in Week 4’s chapter Unit 1: Proof Strategies)

Part B: Translating Human Language to Logic

To see how these equivalences may be used, let be the statement “It is raining” and let be the statement “It is cold”. Match each of the following statements with its logically equivalent; you might rewrite each statement using and to assist you.

  1. It is not the case that it is raining or cold.
  2. It is not raining or it is not cold.
  3. It is not raining and it is not cold.
  4. It is not the case that it is both raining and cold.

Answer template:
Statement ___ is logically equivalent to statement ___ . Statement ___ is logically equivalent to statement ___ .


Question 3:

Purpose

This question aims to help you make sense of implications. There’s really nothing deep behind implications. It is just a logical connective that has a certain behaviour.

To this end, try to consider the following statement below and how we can write it as an implication statement.

Aiken promises Dueet that if Dueet watches anime with him, then Aiken will treat Dueet to a pizza dinner.

Part A:

How would you write this sentence in propositional logic? Do this by trying to identify sentences that you should call , and sentences you should call , and so on. (You can look at how Question 1 of this tutorial has identified their sentences.)

Part B

Determine whether the promise has been broken in each of the following cases:

  1. Dueet watches anime with Aiken, and Aiken treats Dueet to a pizza dinner.
  2. Dueet watches anime with Aiken, but Aiken does not treat Dueet to a pizza dinner.
  3. Dueet does not watch anime with Aiken, and Aiken treats Dueet to a pizza dinner.
  4. Dueet does not watch anime with Aiken, and Aiken does not treat Dueet to a pizza dinner.

Question 4: [Graded Participation]

Purpose

In this tutorial question, we will try to reinforce the concept of reading the notation for first order logic. This comes in a few parts: We will try to get you used to basic set notation, the quantifiers, as well as the predicates.

Recall we mentioned in the chapter Unit 1: Quantifiers that the basic format for quantified statement looks something like this:

And furthermore as an example, a set can be specified like this: . Here, is the set, and we are saying that that set contains two elements, namely: and .

“What if I want to make a set with the name that contains elements ?”

Good question! Then you could just write . So is a set that contains elements .

With that in mind, we have made some sets here for you, we also have listed some predicates. We will specify their behaviours for you.

Let:

  • be the set of circles,
  • be the set of squares,
  • be the set of triangles, and
  • be the set containing all the objects.

You are also given the following predicates, which you may use freely in your answers:

  • is true when object is above object in the grid.
  • is true when object is blue.
  • is true when object is grey.
  • is true when the object is orange.
  • is true when the object is a circle
  • is true when is a square object.
  • is true when is a triangular object.

Determine whether the following statements are true or false for the below picture:

Take note of which set each variable comes from, e.g., in the first statement, which set does variable come from? What possible values can it take?


Question 5: Negating FOL statements

Purpose

Play around with FOL statements! It’s important to know how to manipulate them for writing proofs (later on).

Consider the following first order logic statements:

Write the negation for each of the statements. You may refer to Negating Quantifiers on this.


Question 6:

Purpose

In this next question, we will apply the understanding of first order logic to more commonly encountered sets and practice manipulating statements. It’s a chance to get more familiar with and fluent in reading and manipulating set notation, as well as practicing some tools commonly used to aid in proofs.

Useful notation for sets of numbers for easy reference:

SymbolDefinitionExplanation
Set of natural numbersSet containing the numbers
Set of integersSet containing the numbers
Set of rational numbersSet containing numbers that can be expressed as a fraction of 2 integers, eg: and

Part A: Negating statements

Purpose

Sometimes when attempting to prove a statement, as you will see in the second half of Unit 1, rather than attempting to prove/disprove something directly, it may be easier or more intuitive to disprove/prove its negation. For some of the questions, notice how it is sometimes easier to determine if the negation is true rather than the original statement.

For each of the following statements, write out the negation of the statement, and determine if the original statement is true or false.

Part B: Contrapositive statements

Purpose

Similar to part a, when attempting to prove implication statements, instead of trying to prove/disprove an implication directly, we can consider the contrapositive. Again, in some cases, the contrapositive may be more intuitive or easier to digest than the original statement.

For each of the following implication statements:

  1. Write its contrapositive.
  2. Determine if the statement is true or false.

As an example, when given a statement like:

Then the contrapositive is:

Basically, take the inner implication statement, and re-write it in its contrapositive form.

Statements:


Question 7 [Graded Participation]:

Prove the following statement:

Theorem

Where we define the predicate to be: , and we define the predicate to be:

Notice this theorem is basically say no integer is both odd and even at the same time.

To get you started, we have filled in a few lines of the proof for you, you should try to make sure that the proof is complete:

Partial solution:

  1. Let be arbitrarily chosen from .
  2. Assume for the sake of contradiction that
    1. (Your proof here…)
  3. Contradiction

The clickable hint box below gives a hint on how to approach this proof.

Question 8:

You are tasked with building a load balancer that services clients, and has to balance them between servers. All clients will request to be serviced at the same time at the start of the day, and the load balancer must assign each client a server immediately at the start of the day.

Your boss tells you to keep costs down, that each server must service less than clients in total. Let be the number of clients that the server has to service, e.g., is the number of clients for the first server, is the number of clients for the second server, and so on. Since we have servers, we have quantities .

Question: Prove to yourself and your boss that this is impossible.

Note: This question is a little more open-ended. For example, how do we even formally state “this is impossible” in math? We need to come up with a goal statement that we can try to prove in math. This is probably an interesting point worthy of discussion with your tutorial tutor. In particular, we are normally given these situations we need to deal with in real life. And someone who incorporates discrete math thinking into their toolbox as a technique needs to learn how to do a few things:

  1. Translating their scenario into a mathematical statement that they can either prove, or disprove.
  2. Proving, or disproving that statement.
  3. Interpreting back their result.

So this question above comes with the question of what should we even write as a statement that we should try to prove or disprove?

The clickable hint box below gives a the formal statement we should try to prove. But I encourage you to think a little bit first about what you might write. Then, compare your attempt with what we have written in the hint box.

Here’s another hint on how you might approach the overall proof idea.