BS Artificial Intelligence · Semester 1 · Week 02

Discrete Mathematics for BSAI

Predicate Logic and System Reasoning

Dr. Hira Benish
Associate Professor & HoD, Mathematics
PMAI Lab, Mathematics Behind AI

Week 2 · Dr. Hira BenishBegin reading  

01 · Opening Scenario

A study-support system knows that Ayesha missed the quiz. Its rule says: “Every learner who missed the quiz should be offered a review meeting.” The screen proposes: Offer Ayesha a review meeting.

Can the system conclude this? Yes. Ayesha satisfies the condition in the rule. Now suppose the system proposes: Offer Sara a review meeting. We have said nothing about Sara. Her case may qualify under this or another rule, but the information shown does not establish it.

The Reasoning Lens

  1. Given: separate recorded facts from general rules.
  2. Decide: state the exact proposed conclusion.
  3. Represent: identify who or what the rule is about.
  4. Follows: show each justified step.
  5. Does not follow: explain what remains unknown or what is contradicted.

Week 1 taught what an “if–then” statement says. This week we apply rules to particular people or things, and we carefully distinguish a supported decision from an unsupported one.

02 · Why This Matters

A rule about “every learner” is broader than a rule about one named learner. To use it, we must say which people are under discussion and check whether the known facts meet its condition. This is useful in eligibility checks, reminders, access rules, and transparent support systems.

Central question: Given some facts and rules, what can the system actually conclude? Logical reasoning can show a decision follows from a stated model. It cannot guarantee the recorded facts are accurate or that the policy itself is fair. Those are separate questions.

03 · Learning Objectives and Class Guide

  1. Explain a predicate, variable, and domain in ordinary words and notation.
  2. Read, translate, and negate simple “every” and “at least one” claims.
  3. Use explicit facts and rules to justify a conclusion, reject a contradicted claim, or identify insufficient information.
  4. Trace a short chain of two rules without reversing either rule.
  5. Predict a decision by hand, then check a small Boolean Python example.

Three-hour class guide: 35 minutes for scenario and predicates; 40 for quantifiers and negations; 40 for facts, rules, and Inference Detective; 45 for the case study; 20 for a brief Colab demonstration, feedback, and exit check.

Classroom essentials Sections 01–10 and one Colab cell. Self-study Remaining practice and selected solutions. Detective guesses, discussion, and Python experiments are ungraded; a brief quiz or case response may be formally assessed by the instructor.

04 · Predicates: Statements with a Place to Fill

“Ayesha missed the quiz” can be true or false in a specified context. But “x missed the quiz” has a blank: we need to know who x is. We call M(x) a predicate or propositional function. It becomes a proposition when we replace x with a particular learner (or quantify it, as we will shortly).

A variable is a placeholder such as x. A domain is the set of allowed values for that placeholder. For example, let D = {Ayesha, Bilal, Sara} be the learners in a small tutorial group. Then M(Ayesha) means “Ayesha missed the quiz.” The same notation does not automatically tell us whether M(Sara) is true.

Simple → system example

Two domains, different meanings

If the domain is the three learners, R(x) could mean “x requested help.” If the domain is campus rooms, R(x) could instead mean “room x is reserved.” The letter alone carries no meaning until the domain and predicate are defined. State both before using symbols.

Quick check: If D={Ayesha, Bilal, Sara} and we only know M(Ayesha), is M(Bilal) false? No: no fact was supplied about Bilal. “Not stated” is not the same as “false.”

05 · Quantifiers: “Every” and “At Least One”

Ordinary language often talks about a whole group. The universal quantifier ∀ means “for every member of the stated domain.” The existential quantifier ∃ means “there is at least one member of the domain.” Say the domain aloud whenever you read a quantified expression.

Ordinary statement, domain DMathematical statementHow to check in our finite group
Every learner in D submitted the form.∀x∈D, S(x)Check Ayesha, Bilal, and Sara.
At least one learner in D submitted the form.∃x∈D, S(x)Find one named learner who submitted.
Every learner who missed the quiz needs a check-in.∀x∈D, M(x) → C(x)For each learner, a known miss must lead to a check-in.

In the last row, M(x) → C(x) is inside the scope of “for every.” Learners who did not miss the quiz are not required by this rule to need a check-in. The rule also does not say that only learners who missed a quiz can need a check-in.

Worked example · specified domain

Does a universal claim hold?

Suppose D={Ayesha, Bilal, Sara} and the complete submission record for this group says Ayesha and Sara submitted; Bilal did not. The claim ∀x∈D, S(x) is false because Bilal is a counterexample. The claim ∃x∈D, S(x) is true because Ayesha is one witness. If the record were incomplete, an unlisted submission would remain unknown instead of false.

Domain warning: “Some learner submitted” means at least one; it does not mean “only some” or “not all.” Also, one counterexample disproves a universal claim, while one known example proves an existential claim.

Quick check · choose a claim

Complete record for D={Ayesha, Bilal, Sara}: Ayesha and Sara submitted; Bilal did not. Which claim is true?

06 · Negating “Every” and “At Least One”

Suppose someone says, “Every learner submitted.” To show this is false, you need one learner who did not submit. Suppose someone says, “At least one learner submitted.” To show that is false, you need to establish that none submitted.

¬(∀x∈D, S(x)) ≡ ∃x∈D, ¬S(x)
¬(∃x∈D, S(x)) ≡ ∀x∈D, ¬S(x)

Here ¬ means “not” and ≡ means the two expressions make the same claim. To negate the whole claim, swap “every” with “at least one” and negate the property. Keep the same domain. This week we use the pattern to read claims; Week 3 will examine equivalence more systematically.

Worked translation

From a notice to a logical claim

“Every registered learner received a message” means ∀x∈D, R(x) → G(x), where R(x) means “x is registered,” and G(x) means “x received a message.” Its negation is ∃x∈D, R(x) ∧ ¬G(x): at least one registered learner did not receive a message. Merely finding an unregistered learner with no message would not refute the claim.

Misconception: Negating “all submitted” is not “none submitted.” “Not all” needs only one exception. A claim can fail without its strongest opposite being true.

07 · Facts, Rules, and What Follows

A fact is a stated item in our model, such as M(Ayesha). A rule connects conditions to a consequence, such as ∀x∈D, M(x) → C(x). We may use the rule for Ayesha because she is in D and M(Ayesha) is known. Thus C(Ayesha) follows.

M(Ayesha) and ∀x∈D(M(x) → C(x))
therefore C(Ayesha).

We need three possible verdicts when checking a proposed conclusion P:

VerdictMeaning in this moduleExample
FollowsThe facts and rules establish P.Ayesha missed; every missed learner needs a check-in.
ContradictedThe facts and rules establish ¬P.Fact: the gate is explicitly closed; proposal: the gate is open.
Not enough informationNeither P nor ¬P follows.No fact about whether Sara missed the quiz.

Distinguish the verdicts: A conclusion that does not follow is not necessarily false. Use Contradicted only when the opposite is established, and Not enough information when neither side is established.

No automatic negatives: If our fact list omits M(Sara), we cannot conclude ¬M(Sara). A database may sometimes adopt an explicit “missing means false” policy, but none is assumed here.

Two-rule chain

Suppose every learner who misses a quiz needs a check-in, and every learner who needs a check-in should be offered a meeting. From M(Ayesha), first obtain C(Ayesha); then obtain O(Ayesha). Writing the middle step keeps the reasoning inspectable.

08 · Worked Examples: Understand → Represent → Reason

Example 1 · everyday system

Reminder eligibility

Understand: Every appointment due today receives a reminder. Appointment A for Room 4 is due today. Represent: For the domain of appointments, D(x) means “due today” and R(x) means “receives reminder”; ∀x(D(x) → R(x)) and D(a). Reason: The rule applies to a, so R(a) follows. Interpret: This establishes what the stated rule calls for, not that a device successfully sent a message.

Example 2 · insufficient information

A green light is not proof of a scan

Understand: The gate rule says every valid scan makes a green light appear. We see a green light. Represent: V(a) → G(a) and G(a). Reason: The rule starts with a valid scan; seeing its consequence does not establish its starting condition. A maintenance test might also turn the light green. Interpret: V(a) is unknown from these facts. This is the same direction-of-implication caution as Week 1.

Example 3 · explicit contradiction

Is the room available?

Understand: The complete room-status record explicitly says Room B is occupied. The proposed claim is “Room B is available,” where available means unoccupied. Represent: Let A(B) mean available; the record supplies ¬A(B). Reason: The opposite of the proposal is known. Interpret: This time answer Contradicted, rather than “not enough information.”

Example 4 · quantified claim

Who submitted?

For the complete domain D={Ayesha, Bilal, Sara}, suppose all three are marked “submitted.” We may conclude ∀x∈D, S(x) and also ∃x∈D, S(x), because the domain has members. If we knew only that Ayesha submitted, the existential claim would still follow but the universal claim would remain unestablished.

09 · Inference Detective

Ungraded exploration First predict a verdict without pressing a button. Then test it and explain the reasoning in your own words. “Contradicted” means the opposite is established; “Not enough information” means neither side is established.

1 Predict2 Test3 Explain

10 · Major Case Study 1: Can the System Conclude This?

Scenario. A student-support system suggests review meetings. It is meant to be transparent: a staff member can see exactly which recorded fact and policy rule support a suggestion. It does not diagnose a learner or evaluate academic ability.

Understand · What is known?

The domain for this miniature case is D={Ayesha, Bilal, Sara}. The recorded positive facts are: Ayesha missed the quiz; Bilal requested help. No quiz-status or help-request fact is supplied for Sara. The rules are:

  1. Every learner who missed the quiz needs a check-in.
  2. Every learner who needs a check-in should be offered a review meeting.
  3. Every learner who requested help should be offered a review meeting.

Represent · Build the mathematical model

PredicateMeaning for x∈D
M(x)x missed the quiz
C(x)x needs a check-in under this policy
H(x)x requested help
O(x)x should be offered a review meeting

Facts: M(Ayesha) and H(Bilal).

Rules: ∀x∈D(M(x) → C(x)); ∀x∈D(C(x) → O(x)); ∀x∈D(H(x) → O(x)).

Reason · Trace decisions step by step

Applying Rule 1 to Ayesha gives C(Ayesha). Applying Rule 2 to that new conclusion gives O(Ayesha). Separately, H(Bilal) and Rule 3 give O(Bilal). Therefore ∃x∈D, O(x) follows: Ayesha is already a witness (and Bilal is another).

Does O(Sara) follow? No evidence shown triggers any of the three rules for Sara. But ¬O(Sara) also does not follow. The justified verdict is not enough information. Consequently ∀x∈D, O(x) is not established either. Its negation is also not established from this incomplete record.

Test · Predict, then inspect

Before looking back at the steps, classify these three proposed decisions: O(Ayesha); O(Bilal); O(Sara). State the first fact and last rule for each supported decision. Explain why no negative decision about Sara is justified.

Interpret · What does the mathematics say?

The model justifies offering meetings under a stated policy; it does not say that anyone attended one. The case illustrates how universal rules apply to named individuals, how two rules can be chained, how one witness supports an existential statement, and why absent data should not be turned into a negative claim. Discuss whether a staff review and accurate records are needed before the system acts.

Reflection: If the system later records H(Sara), which new conclusion follows? Would that prove Sara missed the quiz? Explain both answers.

11 · Python / Google Colab Exploration

Do the case-study reasoning on paper first. In a Colab cell, a variable stores a value. Week 1 introduced True, False, and print(). This week if checks a Boolean condition; the indented line runs if it is true. else supplies an alternative branch. A colon begins each branch. We test only one named learner; this code does not implement the universal quantifier or solve the whole case study.

Predict → Test → Explain

Predict: With missed_quiz = True, will the displayed suggestion appear? What happens if you change it to False?

Condition branches to true and false outcomes Condition If True: perform the action If False: this rule alone does not establish the action
Connect the mathematical condition to the two branches of the first Python example.
missed_quiz = True

if missed_quiz:
    needs_check_in = True
    offer_meeting = needs_check_in
    print("Offer Ayesha a review meeting:", offer_meeting)
else:
    print("This rule alone does not decide about Ayesha.")

Test: Run both values in Colab. Explain: The False branch reports uncertainty under this one rule. It does not prove “do not offer a meeting,” since a separate help-request rule might apply.

Mathematics first: Python is checking the inputs we give it. It cannot fill in a missing fact or check whether a recorded fact is correct. Do not interpret the displayed True as an automatic real-world action.

12 · Check Your Understanding and Practice

Try 1–5 independently. Questions 6–7 extend the reasoning. Use the selected solutions at the end only after recording a prediction and an explanation.

  1. With domain D={Ali, Sana}, define P(x) as “x is present.” Is P(x) already a proposition? Is P(Ali) one?
  2. Translate “Every registered student has an ID” and “Some registered student has an ID.” Define the predicates and domain before writing symbols.
  3. Negate ∀x∈D, R(x) in symbols and ordinary words. Negate ∃x∈D, R(x).
  4. Rule: every overdue book triggers a notice. Fact: Book A is overdue. Does “Book A triggers a notice” follow? Show the particular fact and rule.
  5. Rule: every valid card opens the gate. Fact: the gate opened for Bilal. Does “Bilal had a valid card” follow? Give another possible explanation.
  6. For the complete domain D={a,b,c}, P(a)=T, P(b)=T, P(c)=F. Evaluate ∀x∈D, P(x) and ∃x∈D, P(x). Identify a counterexample and a witness.
  7. Facts: R(Nida). Rules: ∀x(R(x)→C(x)) and ∀x(C(x)→S(x)). Trace a two-step conclusion. Does S(Omar) follow if nothing is known about Omar?
Reveal selected solutions

Solutions are collected in the final section so you can work through the chapter before checking them.

Go to selected solutions

13 · Common Mistakes

MisstepBetter reasoning
No fact about Sara, therefore Sara did not miss.Missing data establishes neither a claim nor its negation.
The welcome page appeared, therefore the login was valid.The rule gives valid login → welcome page, not the reverse.
“Not all submitted” means “none submitted.”One learner who did not submit is enough to refute “all.”
One learner submitted, therefore everyone submitted.One witness proves “at least one”; every member must be checked for “all.”
Rule says “should offer,” therefore a message was actually sent.A policy conclusion and an observed event are different claims.

14 · Summary

A predicate P(x) becomes a statement about an individual when x is specified. A domain identifies which values x may take. ∀ means every domain member; ∃ means at least one. To negate “every,” exhibit one exception; to negate “some,” establish none. Apply rules only when their stated conditions are supported. A multi-step conclusion should show its intermediate step.

Reasoning habit: A proposed conclusion may be established, contradicted, or undetermined. Ask which of those descriptions is justified by the information actually given.

15 · Concept Map

DOMAIN D PREDICATE P(x) CLAIMS ABOUT D ∀ EVERY / ∃ SOME FACTS + RULES REASON STEP BY STEP FOLLOWS · CONTRADICTED · UNKNOWN
Figure 2. State the domain, translate the claim, and trace the evidence before deciding.

Reflect: Which branch of the map prevents us from interpreting a missing record as false?

16 · Key Terms

TermWorking meaning
Predicate / propositional functionA statement form whose truth depends on the value of a variable.
Variable; domainA placeholder; the set of allowed values for it.
Universal ∀For every member of the domain.
Existential ∃For at least one member of the domain.
Witness; counterexampleA known example supporting “some”; an example refuting “every.”
Fact; rule; conclusionRecorded premise; general condition; claim justified by them.
Insufficient informationNeither the proposed claim nor its negation is established.

17 · What Comes Next

In Week 3, we will ask why a reasoning pattern is valid across possible cases. We will connect implication with logical equivalence, then build short direct and indirect proofs. Keep this week’s central habit: write down exactly which conclusion follows from which facts and rules.

Exit reflection: “When a fact is missing, I should ______, because ______.”

Selected Solutions and Explanations

Quantifier check: “At least one submitted” is true; Ayesha is a witness. “Every learner submitted” is false because Bilal is a counterexample; “none submitted” is false.

Inference Detective: (1) Follows: Bilal missed and the rule covers every absentee. (2) Not enough information: a welcome page does not establish a valid login. (3) Contradicted by the explicit occupied status. (4) Follows: missed → review → offer. (5) Contradicted by Bilal’s recorded non-submission in the complete domain. (6) Not enough information: neither Omar’s submission nor its negation was given.

Case study: O(Ayesha) follows through Rules 1 and 2. O(Bilal) follows from the help-request fact and Rule 3. O(Sara) remains unknown. Adding H(Sara) establishes O(Sara) but says nothing about M(Sara).

Practice 1: P(x) is an open statement until x is specified or quantified; P(Ali) is a proposition. 2: If D is a domain of students, R(x) registered, and I(x) has an ID, then ∀x∈D(R(x)→I(x)) and ∃x∈D(R(x)∧I(x)). 3: ∃x∈D, ¬R(x) (“some member is not R”); ∀x∈D, ¬R(x) (“none is R”).

Practice 4: Yes, Book A meets the rule’s overdue condition. 5: Unknown: the gate could be opened by an administrator. 6: Universal false (counterexample c); existential true (witness a or b). 7: R(Nida)→C(Nida)→S(Nida); nothing follows about Omar from this information.