MCS-212 · Block 1 Unit 1

Propositional Calculus

Section 8 of 8

Block 1 · Unit 1Propositional Calculus11 min · Section 8 of 8

1.8Applications: web searching and logic circuits

Covers IGNOU MCS-212 §Programme guide topic "Application of Propositional Logic" (Web Page Searching, Logic Circuits); not in the unit PDF

Propositional logic is not only theory. Every search box and every chip in your phone uses it. This section shows two applications that the IGNOU programme guide lists for this unit: Boolean web searches and logic circuits. Unit 3 of this block studies circuits in much more depth.

Boolean searches

A search engine treats each keyword as a proposition about a page: “the page contains this word”. A query is a compound proposition; the engine returns the pages for which it is true.

LogicMeaningGoogle syntax
p∧qp \land qpage contains both wordsignou mca (a space means AND)
p∨qp \lor qpage contains at least oneignou OR nptel (OR in capitals)
¬p\neg ppage does not contain the word-syllabus (minus sign, no space after it)
exact phrasethe words appear together, in order"discrete mathematics"

Library catalogues and many databases use the words AND, OR and NOT directly. In SQL the same idea appears in WHERE clauses: WHERE city = 'Khanna' AND NOT active.

Logic circuits

A logic circuit takes input signals that are 1 (high voltage, true) or 0 (low voltage, false) and produces output signals. It is built from gates:

GateLogicOutput is 1 when
NOT (inverter)¬p\neg pthe input is 0
ANDp∧qp \land qall inputs are 1
ORp∨qp \lor qat least one input is 1

Every compound proposition can be built as a circuit, and every circuit computes a compound proposition. Simplifying the formula with the laws of logic gives a smaller, cheaper circuit — this is the main topic of Unit 3.

Key takeaways

  • In a Boolean search each keyword is a proposition about a page; AND, OR and NOT are ∧\land, ∨\lor, ¬\neg.
  • In Google: a space means AND, OR (capital letters) means OR, -word means NOT, quotes give an exact phrase.
  • Logic gates NOT, AND, OR implement ¬\neg, ∧\land, ∨\lor with 1 and 0.
  • Simplifying a formula with the laws of logic simplifies the circuit (Unit 3).

Practice questions

Answer on paper first, then check. The explanation matters more than the letter you chose.

Question 1 · multiple choice

Let mm: “the page contains mca” and ii: “the page contains ignou”. Which formula describes the Google query mca -ignou?

Show answer

Answer: A. m∧¬im \land \neg i

The space means AND and the minus sign means NOT, so the query is m∧¬im \land \neg i. Option 3 is tempting, but it would also match pages that contain neither word.

Question 2 · multiple choice

Which page matches the query "logic circuits" (python OR java)?

Show answer

Answer: B. A page that contains the phrase logic circuits and the word java

The query is c∧(p∨j)c \land (p \lor j), where cc means the exact phrase. Option 3 is tempting, but quotes require the two words together and in order.

Question 3 · multiple choice

In the circuit for (p∧¬q)∨r(p \land \neg q) \lor r, what is the output when p=1p = 1, q=1q = 1, r=0r = 0?

Show answer

Answer: C. 0

¬q=0\neg q = 0, so p∧¬q=0p \land \neg q = 0, and 0∨0=00 \lor 0 = 0. Option 2 is tempting, but pp goes into an AND gate together with ¬q\neg q, so p=1p = 1 alone is not enough.

Question 4 · multiple choice

Which gate gives output 1 only when all its inputs are 1?

Show answer

Answer: D. AND

AND realises ∧\land, which is true only when all parts are true. Option 1 (OR) gives 1 when at least one input is 1.

Question 5 · multiple choice

In the car alarm circuit A=(d∧¬e)∨bA = (d \land \neg e) \lor b, what is AA when d=1d = 1, e=0e = 0, b=0b = 0?

Show answer

Answer: B. 1

¬e=1\neg e = 1, so d∧¬e=1d \land \neg e = 1, and 1∨0=11 \lor 0 = 1: a door is open while the engine is off. Option 3 is tempting, but the OR gate needs only one input to be 1.

Question 6 · short answer

Describe the circuit for (p∨q)∧¬r(p \lor q) \land \neg r and give its input/output table.

Show worked answer

Circuit: pp and qq go into an OR gate; rr goes into a NOT gate; the outputs of the OR gate and the NOT gate go into an AND gate, whose output is the result. Table for inputs (p,q,r)(p, q, r) in the order 111, 110, 101, 100, 011, 010, 001, 000: p∨qp \lor q = 1, 1, 1, 1, 1, 1, 0, 0; ¬r\neg r = 0, 1, 0, 1, 0, 1, 0, 1; output = 0, 1, 0, 1, 0, 1, 0, 0. The output is 1 exactly when at least one of pp, qq is 1 and rr is 0.

↑ ↓ move↵ openTab switch type