CKC111Discrete Structures CS courses

Study CKC111 one week at a time.

Your lectures and tutorials, turned into short lessons, interactive tools, and practice questions that check your answers straight away.

Your weeks

Pick a week to open it. The bar on each card shows how many of its practice questions you have tried.

How to study with this guide

  1. Read and play. Each week starts with a short lesson. Use the interactive tools to test your understanding before moving on.
  2. Recall, then practise. Answer the recall questions from memory, then try the practice set. Hints come one at a time, and a solution unlocks only after you have tried.
  3. Drill before the exam. Use the Exam Lab for unlimited new questions, then take a timed mock exam. The cheat sheet collects everything on one page.
Tip. On a phone, use the Sections button at the bottom right to jump around inside a week. On a computer, the list on the left does the same.

Learn to read logic like a contract.

Your slides cover propositions, connectives, truth tables and translation. Week 2 continues with logical equivalence. This page teaches them in that order. Where I add something that is not on your slides, I label it "Beyond the slides".

Objectives. By the end you can: decide if a sentence is a proposition; use ¬ ∧ ∨ ⊕ → ↔ and build truth tables; translate English into logic; write the converse, inverse and contrapositive; and use precedence and brackets correctly.

Try it. The promise is: "If you get 100% on the final, then you get an A." That is p → q.

Flip the switches. Only one combination breaks the promise. That is the whole idea behind implication, and the rest of the chapter builds on it.

1. Propositions

A proposition is a declarative sentence that is either true or false. It does not have to be true. It only has to have a truth value.

Tap each sentence to see the verdict.

Propositional variables are p, q, r, … The proposition that is always true is T, and the one that is always false is F.

2. The connectives

A compound proposition is built from smaller propositions with connectives. Choose a connective, flip p and q, and watch which row of the table you are in.

Beyond the slides: a quick memory trick. ∧ is picky (needs everything true). ∨ is easygoing (needs one true). ⊕ is the "one or the other, not both" version of ∨.

Inclusive vs exclusive or. "Students who have taken CS202 or Math120 may take this class" allows both, so it is ∨. "Soup or salad comes with this entrée" allows only one, so it is ⊕.

3. Implication

p → q is read "if p, then q". Here p is the hypothesis and q is the conclusion. Using the promise from the top of the page:

  • Got 100% and got an A: promise kept.
  • Got 100% and no A: promise broken. This is the only way to break it.
  • Did not get 100%: the promise says nothing about this case, so it cannot be broken. The implication is true. We call this vacuously true.

So p → q is false in exactly one row: p true and q false. This is why a sentence like "If 1 + 1 = 3, then your grandma wears combat boots" counts as true in logic.

Different ways to say p → q

EnglishMeaning
if p, then q · q if p · q whenever p · p implies qp → q
p is sufficient for qp → q
q is necessary for pp → q
p only if qp → q
q unless ¬pp → q
Biggest trap. "p only if q" means p → q, not q → p. "I pass only if I study" means that passing forces studying: pass → study.

Biconditional

p ↔ q ("p if and only if q") is true when p and q have the same truth value. Try it in the connectives table above. It means the same as (p → q) ∧ (q → p).

4. Converse, inverse, contrapositive

Start from p → q. You can form three related statements.

Look at the columns. The contrapositive matches the original in every row. The converse and inverse do not, although they match each other.

Example. "If it rains, the ground is wet." The converse is "if the ground is wet, it rained", which can be false because a sprinkler might be on. The contrapositive, "if the ground is not wet, it did not rain", is always valid.

Slide example. "It raining is a sufficient condition for my not going to town" is r → ¬t. Converse: if I do not go to town, then it is raining. Inverse: if it is not raining, then I will go to town. Contrapositive: if I go to town, then it is not raining.

5. Truth-table lab

With n variables you need 2n rows, and one column for every sub-expression. The lab does that for you. Type an expression, or use the symbol buttons. Single lowercase letters are variables, and T and F are constants.

The lab also names each result as a tautology, a contradiction or a contingency. Week 2 explains those names and how to compare two statements.

6. Precedence and translation

Precedence

From highest to lowest: ¬, ∧, ∨, →, ↔. So p ∨ q → ¬r means (p ∨ q) → ¬r. If you want p ∨ (q → ¬r), you must write the brackets. The lab above shows you the fully bracketed form of whatever you type.

Translating English

Two steps from your slides: (1) identify the atomic propositions and give each a variable, (2) choose the connectives.

"If I go to Harry's or to the country, I will not go shopping."

p: I go to Harry's. q: I go to the country. r: I go shopping.
(p ∨ q) → ¬r

"You can access the Internet from campus only if you are a computer science major or you are not a freshman."

a: you can access the Internet from campus. c: you are a CS major. f: you are a freshman.
a → (c ∨ ¬f)

"The automated reply cannot be sent when the file system is full."

p: the automated reply can be sent. q: the file system is full.
q → ¬p

Beyond the slides: find the "if / only if / unless" word first. It splits the sentence into hypothesis and conclusion. Then translate each side.

7. Common mistakes

  • Thinking p → q is false when p is false. It is true.
  • Reading "p only if q" as q → p.
  • Claiming the converse or inverse is equivalent to the original. Only the contrapositive is.
  • Forgetting that ∨ is inclusive unless ⊕ is stated.
  • Leaving out brackets when precedence changes the meaning.
  • Skipping rows. Always list all 2n rows systematically.

Where this goes next. Week 2 turns to logical equivalence: tautologies, De Morgan's Laws and proofs with named laws. Everything you learned here, especially the truth tables and p → q, is the machinery for it.

8. Active recall

Answer from memory in the box, then check. The check button unlocks once you have typed something.

9. Practice set

Three easy, four medium, three challenging. Write your attempt first. Hints come in three levels, and the full solution unlocks only after you have written an attempt. Use the truth-table lab to check your tables, but do the reasoning yourself.

10. Weekly checkpoint

Rate how you feel about each objective, then build your checkpoint.