0% found this document useful (0 votes)
289 views16 pages

Informatics College, Pokhara: MA4001NP Logic and Problem Solving

The document contains solutions to logic and problem solving test questions from Informatics College in Pokhara, Nepal. It includes solutions to questions on argument validity using truth tables, verifying De Morgan's laws, simplifying logical expressions using laws of logic, constructing logic circuits from output functions, and designing logic circuits based on word problems. Diagrams of logic circuits and truth tables are provided as part of the solutions.

Uploaded by

Anjal Mahato
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)
289 views16 pages

Informatics College, Pokhara: MA4001NP Logic and Problem Solving

The document contains solutions to logic and problem solving test questions from Informatics College in Pokhara, Nepal. It includes solutions to questions on argument validity using truth tables, verifying De Morgan's laws, simplifying logical expressions using laws of logic, constructing logic circuits from output functions, and designing logic circuits based on word problems. Diagrams of logic circuits and truth tables are provided as part of the solutions.

Uploaded by

Anjal Mahato
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/ 16

Informatics College, Pokhara

MA4001NP
Logic and Problem Solving

Solution of Test-I

Submitted By:
Submitted To:
Name of the London Met ID
student Mr. Aananda Bhattarai
Module Leader, Logic and
Problem Solving

Anjal Mahato(C4) 20048637

Date:
Attempt all the questions.

1. Check the validity of the following argument:

If you are a flower lover, then you work in the garden. If you don’t like roses, then

you don’t work in the garden. Therefore, if you are flower lover, then you like

roses.

Ans: Let, you are a flower lover = p

You work in a garden = q

You don’t like roses = ¬r


You donot work in a garden = ¬ q

You like roses = r

According to the question,

If you are a flower lover then you work in a garden = p→q

If you don’t like roses, then you don’t work in the garden = ¬r→ ¬q
If you are flower lover, then you like roses = p→r

The argument in symbolic form,


p→q, ¬r→¬q, ├ p→r

In order to show that the above argument is valid , we need to show that X = [(p→q) ∧(¬r→¬q)]
→ (p→r) is a tautology.

Truth table:
p Q r p→q ¬r ¬q ¬r→¬q (p→q) (p→r) X
∧(¬r→¬q)
T T T T F F T T T T
T F F T T F F F F T
T T T F F T T F T T
T F F F T T T F F T
F T T T F F T T T T
F F F T T F F F T T
F T T T F T T T T T
F F F T T T T T T T
Here from the truth table its proved that X = [(p→q) ∧(¬r→¬q)] → (p→r) is a tautology.

Hence, the given argument is valid.

2. Verify De Morgan’s laws using truth table.

Ans: DE Morgan Laws: i) ¬(pvq) ≡ ¬p∧ ¬q

ii) ¬(p∧q) ≡ ¬p v ¬q

i) ¬(pvq) ≡ ¬p∧ ¬q

Truth Table:

p q pvq ¬(pvq) ¬p ¬q ¬p∧ ¬q

T T T F F F F

T F T F F T F

F T T F T F F

F F F T T T T

The value of column 4 i.e. ¬(pvq) and column 7 i.e. ¬p∧ ¬q are same. Therefore ¬(pvq) ≡ ¬p∧ ¬q to each
other.

ii) ¬(p∧q) ≡ ¬p v ¬q

Truth table

P q ¬p ¬q p∧q ¬(p∧q) ¬p v ¬q
T T F F T F F
T F F T F T T
F T T F F T T
F F T T F T T

In the truth table, column 6 i.e. ¬(p∧q) and column 7 i.e. ¬p v ¬q have the same value. Therefore ¬(p∧q)
≡ ¬p v ¬q to each other.
3.

a) Construct a truth table to show that (p → q) ↔ (¬p ⋁ q) is a tautology.

Solution:

To show the given propositions tautology, every entry in the last column should be True value (T).

Given proposition (p → q) ↔ (¬p ⋁ q)

Truth table:

p q ¬p p→q ¬p ⋁ q (p → q) ↔ (¬p
⋁ q)

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

Here, every entry in the last column is T. This means the proposition evaluates to true for all possible
combination of Truth values of its component propositions.

Hence, the above proposition is Tautology.

b) Show that ¬ (p ∨ (¬p ∧ q)) and (¬p ∧¬q) are logically equivalent by using laws.

Solution:

¬ (p ∨ (¬p ∧ q)) ≡ ¬ p ∧ ¬ (¬p ∧ q)) (De Morgan Law)

≡ ¬ p ∧[ ¬ (¬p) v ¬q)) (De Morgan Law)

≡ ¬ p ∧ (p v ¬ q) (Double Negation Law)

≡ (¬ p ∧ p) v (¬p ∧ ¬ q) (Distributive Law)

≡ (p∧¬ p) v (¬p ∧ ¬q) (Commutative law)

≡ False v (¬p ∧¬ q) (Complement law)

≡ (¬p ∧¬ q) v False (Commutative law)

≡(¬p ∧¬ q) (Identity law)

By using laws, it is proved that ¬ (p ∨ (¬p ∧ q)) and (¬p ∧¬q) are logically equivalent.
4. Provided the output function:

X = A. B. C + A. B. C̅+ A. B̅ . C + A̅ . B. C

a) Using the laws, simplify the expression as much as possible.

b) Construct the logic circuit of the simplified expression.

c) Construct the truth table of the simplified expression.

Solution:

Given

X = A. B. C + A. B. C̅+ A. B̅ . C + A̅ . B. C

Step 1: Simplifying the given expression

X = A. B. C + A. B. C̅+ A. B̅ . C + A̅ . B. C

= A. B. C + A. B. C̅+ A. B̅ . C + A̅ . B. C + A.B.C + A.B.C

=( A̅ . B. C + A. B. C) + (A. B̅ . C + A. B. C) + (A. B. C̅ + A. B. C)

= (A. B. C + A̅ . B. C) + (A. B. C + A. B̅ . C) + (A. B. C + A. B. C̅ ) (Commutative Law)

= (A+ A̅ ) B.C + (B+ B̅ ) A.C +(C+ C̅) A.B

=1. B.C + 1. A.C + 1.A.B (Complement Law)

= B.C + A.C + A.B (Identity law)

Step 2: The circuit for the simplified function X requires three gates:

A.B

OR
Step 3: Truth table for the simplified expression i.e. X = AB + BC + AC

A B C A.B B.C A.C X


0 0 0 0 0 0 0
0 0 1 0 0 0 0
0 1 0 0 0 0 0
0 1 1 0 1 0 1
1 0 0 0 0 0 0
1 0 1 0 0 1 1
1 1 0 1 0 0 1
1 1 1 1 1 1 1

5. Build a digital circuit that produces the output (A + B̅ ) [A̅ + (B + C̅)] when given input bits A, B, and C.
Also, construct the truth table.

Solution:

Suppose given output function ‘X’ i.e. X = (A + B̅ ) [A̅ + (B + C̅)]. The circuit for the output function X
requires 3 gates.

A+ B̅

B B̅

C C̅

Ooo

o B+ C̅

A̅ A̅ +(B+ C̅).
6. Draw the logic circuit for the following output functions.

i) F = XZ + Y̅Z + X̅YZ̅

X X̅

Y X̅ YZ̅

Z Z̅

XZ

Y̅Z
̅̅̅̅ )
ii) Q = (A̅ BC)(̅A̅ +D̅

A A̅

B A̅ BC

D
̅
A+D (̅A̅ +̅̅D̅̅ )
7. A system uses 3 switches W, X and Y ; a combination of switches determines whether an alarm, Z,
sounds. If switch W or switch Y are in the ON position and switch X is in the OFF position then a signal to
sound an alarm, Z, is produced. Design the logic of the circuit using the appropriate logic gates and
construct the truth table to show all possible output.

Solution:

So we get

If (W=1 OR Y = 1): The first part is two inputs(W and Y )joined by an OR gate.

AND: The output from the first part and the third part are joined by an AND gate

(X= NOT 1) then Z= 1 : The third part is one input (X) which is put through a NOT gate.

So, we get the following logic circuit

W+Y

X X̅
This gives the following truth table:

W Y X X̅ W+Y Z[X̅ .(W+Y)]


0 0 1 0 0 0
0 0 0 1 0 0
0 1 1 0 1 1
0 1 0 1 1 0
1 0 1 0 1 1
1 0 0 1 1 0
1 1 1 0 1 1
1 1 0 1 1 0

8. Given U= {1, 2, 3, ..., 15}. A= {x: x ∈ U, x ≥ 8}, B= {x: x ∈ U, x ≤4} and C= {x : x

∈ U, 4< x < 12}.

a) Put all the information on Venn Diagram

b) Find A ∩ C

c) Find B ꓴ C

d) Find (A ꓴ C) - B

e) Find (Aꓴ B) - (A∩ B)

Solution:

Given,

U= {1, 2, 3, ..., 15}.

A= {x: x ∈ U, x ≥ 8} = {8,9,10,11,12,13,14,15}

B= {x: x ∈ U, x ≤4} = {1,2,3,4}

C= {x : x∈ U, 4< x < 12}. = {5,6,7,8,9,10,11}


a) Venn- Diagram

A B

12,13,14,15 1,2,3,4

8,9,10

9,6,7

b. A = {8,9,10,11,12,13,14,15}

C = {5,6,7,8,9,10,11}

AnC = {8,9,10,11,12,13,14,15} n {5,6,7,8,9,10,11}

= {8,9,10,11}

c. B = {1,2,3,4}

C = {5,6,7,8,9,10,11}

BUC = {1,2,3,4} U {5,6,7,8,9,10,11}

={1,2,3,4,5,6,7,8,9,10,11}

d. A{8,9,10,11,12,13,14,15}

B{1,2,3,4}

C{5,6,7,8,9,10,11}
AUC = {8,9,10,11,12,13,14,15} U {5,6,7,8,9,10,11}

= {5,6,7,8,9,10,11,12,13,14,15}

AUC – B = {5,6,7,8,9,10,11,12,13,14,15} – {1,2,3,4}

= {5,6,7,8,9,10,11,12,13,14,15}

e) (AUB) – (AnB)

A = {8,9,10,11,12,13,14,15}

B = {1,2,3,4}

AUB = {8,9,10,11,12,13,14,15} U {1,2,3,4}

= {1,2,3,4,8,9,10,11,12,13,14,15}

AnB = {8,9,10,11,12,13,14,15} n {1,2,3,4}

={}

(AUB) – (AnB) = {1,2,3,4,8,9,10,11,12,13,14,15} – { }

= {1,2,3,4,8,9,10,11,12,13,14,15}
9. Draw the Venn diagrams for each of these combinations of the sets A,B and C.

a) (A ∩ B) ∪ (A ∩ C)

AnB AnC

(AnB) U (AnC)

b) (A ∩ B’) ∪ (A ∩ C’)
B’ An B’

C’ An C’

(A ∩ B’) ∪ (A ∩ C’)

10.In a group of students 18 read Books, 19 read Magazines and 16 read Novels.

6 read Books only, 9 read Magazines only, 5 read Books and Magazines only

and 2 read Magazines and Novels only.

a) Put all the information in Venn- Diagram.

b) How many students read all three ?

c) How many read Books and Novels only?

d) How many read Novels only?

e) How many students are there all together?


Solution:

Let, n(B) be the number of students who reads books, n(M) be the number of students who reads
magazines, n(N) be the number of students who reads novels. no(B) be the number of students who
reads books only, no(M) be the number of students who reads magazines only, no(N) be the number of
students who read novel only.

Here,

n(B) =18

n(M) = 19

n(N) = 16

no(B) = 6

no(M) = 9

no(BnM) = 5

no(MnN) = 2

a) Venn- Diagram

6 5 9

4 2

b) According to Venn-diagram, there are 3 students who read all books.

c) According to the Venn-Diagram, there are 4 students who reads books and novels only.

d) According to the Venn-Diagram, there are 7 students who reads novels only.
e) According to the Venn-Diagram, there are altogether 36 students.

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