0% found this document useful (0 votes)
63 views7 pages

Week 4 Notes - (Logics)

Uploaded by

motherfucker2222
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)
63 views7 pages

Week 4 Notes - (Logics)

Uploaded by

motherfucker2222
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
You are on page 1/ 7

⃝Francis

c Oketch

1 Logic
Definition 1.1 (Logic). It is the systematic study of valid reasoning, sound argumentation, and
inference.

It involves evaluating the validity of mathematical arguments, distinguishing between true and false
statements, and identifying errors in reasoning. It aims to understand how conclusions are drawn from
premises. Logic is critical in mathematics, computer science, philosophy, and other fields, helping to
ensure rational and consistent thinking.

1.1 Propositions
Definition 1.2 (Proposition). It is a statement which is either true or false.

The truth values of propositions are T (if it is a true statement) or F (if it is a false statement). For
instance,

• It is raining today.

• Arsenal will win Premier League next season.

• Jomo Kenyatta was the 1st president of USA. [F]


1
• is a rational number. [T]
2
• 2 + 4 = 1. [F]

• How are you doing? [Not a proposition because it is not a statement]

• x2 = 36. [Not a proposition because the variable x has not been assigned any value. It is an
open sentence]

The above propositions are called simple propositions. Compound propositions can be formed by
connectives with simple propositions. For example,

• “1 + 2 = 5” and “the sun is made of an orange”.

We usually use lower case letters p, q, r, s to denote propositions. In propositions, we avoid dealing
with ambiguous case, i.e., statements that are both true and false at the same time.

Definition 1.3 (Truth table). It displays all possible truth values of a logical expression or a set of
propositions.

In a truth table if the number of propositions are n, then the number of rows is 2n . Truth tables
are essential tools for evaluating the validity and behavior of logical expressions, especially in more
complex logical reasoning and analysis. They help in understanding how different combinations of
truth values affect the overall truth value of a logical statement.

1.2 Connectives
Let p and q be two propositions. Then,

Definition 1.4 (Negation). The negation of p, denoted by ∼ p or ¬p, is the proposition “NOT p”. It
is true (T) whenever p is false. Otherwise, it is false.

For example:

• p is the statement “it is cold”

• ∼ p is the statement “it is not cold”

The truth table for the negation of the proposition p is as follows

1
1.2 Connectives ⃝Francis
c Oketch

p ∼p
T F
F T

Definition 1.5 (Conjunction). The conjunction of p and q, denoted by p ∧ q, is the compound


proposition “p AND q”. It is true (T) whenever both p and q are true. Otherwise, it is false.

For example:

• p is the statement “it is cold”

• q is the statement “it is raining”

• p ∧ q is the statement “it is cold and it is raining”

The truth table for the conjunction of two propositions p and q is as follows
p q p∧q
T T T
T F F
F T F
F F F

Definition 1.6 (Disjunction). The disjunction of p and q, denoted by p∨q, is the compound proposition
“p OR q”. It is true (T) when at least one of p or q is true. Otherwise, it is false.

For example:

• p is the statement “it is cold”

• q is the statement “it is raining”

• p ∨ q is the statement “it is cold or it is raining”

The truth table for the disjunction of two propositions p and q is as follows
p q p∨q
T T T
T F T
F T T
F F F

Definition 1.7 (Exclusive Or). The exclusive Or of p and q, denoted by p ⊕ q or p XOR q, is the
compound proposition “p or q, and not both p and q”. It is true (T) when exactly one of p and q is
true. Otherwise, it is false.

For example:

• p is the statement “it is cold”

• q is the statement “it is raining”

• p ⊕ q is the statement “it is cold or it is raining, and not both cold and raining”

The truth table for the exclusive Or of two propositions p and q is as follows
p q p⊕q
T T F
T F T
F T T
F F F

Note that p ⊕ q is equivalent to (p ∨ q) ∧ (∼ (p ∧ q)).


→ Note:

2
1.2 Connectives ⃝Francis
c Oketch

 A propositional form (or compound proposition) is an expression involving finitely many


propositions connected by logical connectives. E.g., (∼ (p ∨ q)) ∧ (r ∧ (∼ p)).

 Two compound propositions A and B are called logically equivalent if, and only if, their truth
tables are identical. In this case, we write A ≡ B.

 A denial of a proposition p is any proposition that is logically equivalent to ∼ p. For example,


∼∼∼ p and ∼∼∼∼∼ p.

 A compound proposition is called a

• tautology if it is true for all possible truth values of its components. In other words, the
last column in the truth table has every entry “T”. For example, (∼ p) ∨ p.
• contradiction if it is the negation of a tautology. In other words, the last column in the
truth table has every entry “F”. For example, p ∧ (∼ p).
• contingency if it is neither a tautology nor a contradiction.

Example(s):

1. Let p be “Kuwait is an island”, q be “Sea water contains salt”, and r be “it is raining today”.
Discuss the truth value of (∼ (p ∨ q)) ∧ (r ∧ (∼ p)).

Solution
The truth table is:

p q r p∨q ∼ (p ∨ q) ∼p r ∧ (∼ p) (∼ (p ∨ q)) ∧ (r ∧ (∼ p))


T T T T F F F F
T T F T F F F F
T F T T F F F F
T F F T F F F F
F T T T F T T F
F T F T F T F F
F F T F T T T T
F F F F T T F F

Hence, the propositional form (∼ (p ∨ q)) ∧ (r ∧ (∼ p)) is true only if p is false and q false and r
is true. Otherwise, it is false.

2. Let p be “π is an irrational number”. Find the negation of p, and give any three examples of
denials of p.

Solution

• ∼ p : It is not the case that π is irrational.


• Denials of p:
i) π is rational.
a
ii) π is the quotient of two integers .
b
iii) π has a finite decimal expansion.
Note that since p is true, all of its denials are false.

3. Show that (p ∨ q) ∨ ((∼ p) ∧ (∼ q)) is a tautology for any propositions p and q.

Solution
The truth table is:

3
1.3 Conditionals and Biconditionals ⃝Francis
c Oketch

p q p∨q ∼p ∼q (∼ p) ∧ (∼ q) (p ∨ q) ∨ ((∼ p) ∧ (∼ q))


T T T F F F T
T F T F T F T
F T T T F F T
F F F T T T T

Since (p ∨ q) ∨ ((∼ p) ∧ (∼ q)) is true for all possible truth values of p and q, it is a tautology.
Moreover, it can be seen that the negation of (p ∨ q) ∨ ((∼ p) ∧ (∼ q)) is a contradiction.

Exercise:

1. Let p, q, and r be three propositions. Construct the truth table of the propositional form

(a) (p ∨ q) ∧ (∼ r)
(b) (p ∧ q) ∨ (p ∨ (∼ r))

2. Show that:

(a) (∼ (p ∨ q)) ≡ ((∼ p) ∧ (∼ q))


(b) (∼ (p ∧ q)) ≡ ((∼ p) ∨ (∼ q))
(c) (p ∧ (q ∨ r)) ≡ ((p ∧ q) ∨ (p ∧ r))
(d) (p ∨ (q ∧ r)) ≡ ((p ∨ q) ∧ (p ∨ r))

3. Verify that p∨ ∼ (p ∧ q) is a tautology.

4. Let p be a proposition. If t is a tautology and c is a contradiction, show that p ∧ t ≡ p and


p ∧ c ≡ c. Use truth table.

1.3 Conditionals and Biconditionals


Let p and q be two propositions. Then,

Definition 1.8 (Conditional). The logical implication or conditional sentence p ⇒ q or p → q (read


as “p implies q”) is the compound proposition “if p, then q”. It is true (T) whenever p is false or q is
true.

In other words, p ⇒ q is false when p is true and q is false; otherwise it is true. In this case, p is called
the hypothesis or premise or antecedent and q is called the conclusion or consequent. For example,
let

• p is the statement “it is cold”

• q is the statement “it is raining”

• p ⇒ q is the statement if “it is cold”, then “it is raining”

Note that (p ⇒ q) ≡ ((∼


. p) ∨ q) . This is illustrated using the truth table:

p q p⇒q ∼p (∼ p) ∨ q
T T T F T
T F F F F
F T T T T
F F T T T
→ Note:

• The inverse of p ⇒ q is (∼ p) ⇒ (∼ q).

• The converse of p ⇒ q is q ⇒ p. Thus, (q ⇒ p) ≡ ((∼. p) ⇒ (∼ q)) , i.e, the converse of a


conditional is logically equivalent to its inverse.

4
1.3 Conditionals and Biconditionals ⃝Francis
c Oketch

• The contrapositive of p ⇒ q is (∼ q) ⇒ (∼ p). In other words, a contrapositive is the inverse


of the converse of a conditional. Thus, (p ⇒ q) ≡ ((∼. q) ⇒ (∼ p)) , i.e, a conditional is logically
equivalent to its contrapositive.

Example(s):

1. Find the inverse, converse and contrapositive of if today is Friday, then I have a test today.

Solution
Let p be “today is Friday” and let q be “I have a test today”. Given the conditional sentence
p ⇒ q, we have

• Inverse: ∼ p ⇒∼ q, i.e., if today is not Friday, then I don’t have a test today.
• Converse: q ⇒ p, i.e., if I have a test today, then today is Friday.
• Contrapositive: ∼ q ⇒∼ p, i.e., if I didn’t have a test today, then today is not Friday.

Definition 1.9 (Biconditional). The double implication or biconditional sentence p ⇔ q or p ↔ q


(read as “p implies q and q implies p ”) is the compound proposition “p if, and only if, q”. It is true
(T) when both p and q have the same truth value.

Note that “if, and only if,” is abbreviated as “iff”. For example, let

• p is the statement “it is cold”

• q is the statement “it is raining”

• p ⇔ q is the statement “it is cold” iff “it is raining”.

Note that (p ⇔ q) ≡ ((p ⇒


. q) ∧ (q ⇒ p)) . This is illustrated using the truth table:

p q p⇔q p⇒q q⇒p (p ⇒ q) ∧ (q ⇒ p)


T T T T T T
T F F F T F
F T F T F F
F F T T T T

Exercise:

1. Show that:

(a) (∼ (p ⇒ q)) ≡ (p ∧ (∼ q))


(b) (p ⇒ (∼ q)) ≡ (∼ (p ∧ q))

2. Write the following sentence into a logical expression

(a) “You can access internet from campus only if you are a computer science major or you are
not a freshman”.

3. Find the inverse, converse and contrapositive of the following sentences.

(a) If you live in Nairobi, then you live in Kenya.


(b) If ABCD is a square, then ABCD is a rectangle.

4. Construct a truth table for each of the following compound proposition

(a) (p ⇒ q) ∨ ((∼ p) ⇒ q)
(b) (p ⇔ q) ∨ ((∼ p) ⇔ r)
(c) p ⇒ (q ∧ [(q ∧ (∼ r)) ⇒ (p ∨ r)])

5
1.4 Logic Gates and Circuits ⃝Francis
c Oketch

(d) p ⇒ (q ∧ [(p ∨ (∼ r)) ⇒ (q ∧ r)])

5. Let p, q and r be the propositions

• p: “You get an A on the final exam”


• q: “You do every exercise in this book”
• r: “You get an A in this class”

Express the following in English

(a) p ⇒ (∼ q) ∨ r
(b) ∼ p ⇒ (q ⇒ r
(c) (p ∨ q) ∨ r
(d) (p ∧ q) ∨ r
(e) (p ∧ q) ∧ (∼ r)

6. Using truth tables, show that each of the following is tautology.

(a) (∼ p) ∧ (p ∨ q) ⇒ q
(b) [(p ⇒ q) ∧ (q ⇒ r)] ⇒ (p ⇒ r)

1.4 Logic Gates and Circuits


The Boolean expressions can be graphically represented by using logic circuits. These logic circuits
can be constructed using solid-state devices called gates, which are capable of switching voltage levels.
If x and y are variables, then the basic expressions are x ∧ y (AND), x ∨ y (OR), and ∼ x (NOT). We
can interconnect these devices to form an electronic circuit that realizes any given Boolean Expression.

1.4.1 AND Gate


An AND gate receives inputs x and y and produces output denoted by x ∧ y, as shown in logic table

x y x∧y
1 1 1
1 0 0
0 1 0
0 0 0

1.4.2 OR Gate
An OR gate receives inputs x and y and produces output denoted by x ∨ y, as shown in logic table

x y x∨y
1 1 1
1 0 1
0 1 1
0 0 0

1.4.3 NOT Gate


A NOT Gate receives input x and produces output y denoted ∼ x as shown in the logic table

x y =∼ x
1 0
0 1

6
1.4 Logic Gates and Circuits ⃝Francis
c Oketch

1.4.4 Applications of Boolean Algebra in Switching Theory


The simplest switching device is ON-OFF switch. A switch is a device or an electric circuit which
lets or does not let the current to flow through the circuit. The switch has two states ON or OFF
(closed or open circuit).

• If the switch is closed, current will pass through it. If the switch is open, current will not pass
through it.

• ON is denoted by 1. OFF is indicated by 0.

The electrical circuits containing switches by Boolean expressions, if ON is denoted by true or 1 and
OFF is denoted by False or 0.
1

1
Mathematics is fun!

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy