0% found this document useful (0 votes)
11 views3 pages

Rules of Inference in Computer Science

The document outlines various rules of inference used in logic, including Modus Ponens, Modus Tollens, and others, along with examples for each. It also presents exercises to apply these rules and determine the validity of arguments. The tutorial is part of a computer science course at Concordia University for Fall 2025.

Uploaded by

itsroro13
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Rules of Inference in Computer Science

The document outlines various rules of inference used in logic, including Modus Ponens, Modus Tollens, and others, along with examples for each. It also presents exercises to apply these rules and determine the validity of arguments. The tutorial is part of a computer science course at Concordia University for Fall 2025.

Uploaded by

itsroro13
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CONCORDIA UNIVERSITY

DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING


COMP 232: Mathematics for Computer Science
Fall 2025
Tutorial #3

Instructor: Natalia Vasilyeva


Tutorial Instructor: Rushin Dipak Makwana

Rules of Inference

- Modus Ponens: A fundamental rule that states if you have a conditional statement
("if p, then q") and you know that the hypothesis p is true, you can conclude that q is
also true.
Example: "If it's raining, the ground is wet. It is raining. Therefore, the ground is wet.

- Modus Tollens: This rule works with the contrapositive. If you have "if p, then q" and
you know that the conclusion q is false, you can conclude that the
hypothesis p must also be false.
Example: "If it's raining, the ground is wet. The ground is not wet. Therefore, it is not
raining.

- Hypothetical Syllogism: This rule allows you to chain together conditional


statements. If you know "if p, then q" and "if q, then r," you can conclude "if p, then r."
Example: "If I study, I'll pass. If I pass, I'll be happy. Therefore, if I study, I'll be happy."

- Addition: A simple rule stating that if a statement p is true, then the statement "p or
q" must also be true.
Example: "It is sunny. Therefore, it is either sunny or it is cold."

- Resolution: A powerful rule used in automated theorem proving. It takes two


premises in the form of "p or q" and "not p or r" and concludes "q or r." It eYectively
"cancels out" the variable that appears in both its positive and negative forms.

- Universal Instantiation: This rule allows you to move from a general statement to a
specific one. If you know that a property is true for all elements in a domain, then it
must be true for any particular element you choose from that [Link]: "All
dogs are mammals. Fido is a dog. Therefore, Fido is a mammal."
- Disjunctive Syllogism: is a rule that applies when you have an "or" statement and
you know that one of the options is false. This allows you to conclude that the other
option must be true. If P or Q is true and you have ¬P is true. (P is false) then you can
conclude Q is true.
Example: The course is either in Room 202 or in Room 305. The course is not in
Room [Link], the course is in Room 305.

- Simplication: The rule of Simplification is the reverse of Addition. It states that if you
have a true "and" statement (a conjunction), you can infer that each of its individual
parts is true on its own.
• Premise: P ∧ Q is true.
• Conclusion: Therefore, P is true. (You can also conclude that Q is true).

- Fallacies: These are common errors in reasoning that result in invalid arguments.
• AYirming the Consequent: The error of assuming that if the conclusion ("q")
of an "if p, then q" statement is true, then the hypothesis ("p") must also be
true. This is not always the case.
• Fallacy of Denying the Hypothesis: This fallacy is the other common error
related to conditional statements.
• Premise 1: If P, then Q. (P → Q)
• Premise 2: P is false. (¬P)
• Flawed Conclusion: Therefore, Q must be false. (¬Q).

1. What rule of inference is used in the following argument?


"If it is snowing, the roads are slippery. The roads are not slippery. Therefore, it is not
snowing."

2. Determine whether the following argument is valid. If it is valid, state the rule of
inference used. If it is not, identify the fallacy.
"If you have a key, you can open the door. You opened the door. Therefore, you have
a key."
3. Use rules of inference to show that the conclusion "Maggie is not a computer science
major" follows from the premises:
• "All computer science majors own a laptop."
• "Maggie does not own a laptop."

4. Translate the following argument into symbolic logic and then determine if it is valid.
"If the alarm goes oY, I will wake up. The alarm did not go oY. Therefore, I did not wake
up."

5. Use rules of inference to show that the premises "Linda, a student in this class, is not
from France" and "Everyone in this class is from France or is a computer science
major" imply the conclusion "Linda is a computer science major.”

6. Use resolution to show that the hypotheses "The bug is in the code or the input is
faulty" and "The bug is not in the code or the documentation is incomplete" imply that
"The input is faulty or the documentation is incomplete."

7. If you know that the statement "It is Tuesday" is true, what can you conclude using
the rule of Addition?

8. If you know that the statement "It is raining and the wind is blowing" is true, what can
you conclude using the rule of Simplification?

9. Determine whether the following argument is valid. If not, identify the fallacy.
"If a student is a senior, then they have priority registration. A student has priority
registration. Therefore, that student is a senior."

10. If the car has gas, then it will run" and "The car has gas," what valid conclusion can
be drawn?

You might also like