0% found this document useful (0 votes)
17 views

Assignment Questions

Uploaded by

Pashal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Assignment Questions

Uploaded by

Pashal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

ASSIGNMENT

QUESTIONS
Application of logic
1. Logic Circuits
2. Logic Puzzles
3. Boolean Searches
4. System Specifications
5. Translating English Sentences
• 6. Express these system specifications using the propositions p:
“The message is scanned for viruses” and q: “The message was sent
from an unknown system” together with logical connectives
(including negations).
• a) “The message is scanned for viruses whenever the message was
sent from an unknown system.”
• b) “The message was sent from an unknown system but it was not
scanned for viruses.”
• c) “It is necessary to scan the message for viruses whenever it was
sent from an unknown system.”
• d) “When a message is not sent from an unknown system it is not
scanned for viruses.”
• 7. Express these system specifications using the propositions p: “The
user enters a valid password,” q: “Access is granted,” and r: “The user
has paid the subscription fee” and logical connectives (including
negations).
• a) “The user has paid the subscription fee, but does not enter a valid
password.”
• b) “Access is granted whenever the user has paid the subscription fee
and enters a valid password.”
• c) “Access is denied if the user has not paid the subscription fee.”
• d) “If the user has not entered a valid password but has paid the
subscription fee, then access is granted.”
• 8. An explorer is captured by a group of cannibals. There are
two types of cannibals—those who always tell the truth and
those who always lie. The cannibals will barbecue the
explorer unless he can determine whether a particular
cannibal always lies or always tells the truth. He is allowed to
ask the cannibal exactly one question.
• a) Explain why the question “Are you a liar?” does not work.
• b) Find a question that the explorer can use to determine
whether the cannibal always lies or always tells the truth.
• 9. When three professors are seated in a restaurant, the hostess
asks them: “Does everyone want coffee?” The first professor says “I
do not know.” The second professor then says “I do not know.”
Finally, the third professor says “No, not everyone wants coffee.”
The hostess comes back and gives coffee to the professors who
want it. How did she figure out who wanted coffee?
• 10. When planning a party you want to know whom to invite.
Among the people you would like to invite are three touchy friends.
You know that if Jasmine attends, she will become unhappy if Samir
is there, Samir will attend only if Kanti will be there, and Kanti will
not attend unless Jasmine also does. Which combinations of these
three friends can you invite so as not to make someone unhappy?
11. (a) What Boolean search would you use to look for Web pages
about beaches in New Jersey? What if you wanted to find Web pages
about beaches on the isle of Jersey (in the English Channel)?
. (b) What Boolean search would you use to look for Web pages about
hiking in West Virginia? What if you wanted to find Web pages about
hiking in Virginia, but not in West Virginia?
12. Five friends have access to a chat room. Is it possible to determine
who is chatting if the following information is known? Either Kevin or
Heather, or both, are chatting. Either Randy or Vijay, but not both, are
chatting. If Abby is chatting, so is Randy. Vijay and Kevin are either both
chatting or neither is. If Heather is chatting, then so are Abby and Kevin.
Explain your reasoning.
13.A detective has interviewed four witnesses to a crime. From the stories of the
witnesses the detective has concluded that if the butler is telling the truth then
so is the cook; the cook and the gardener cannot both be telling the truth; the
gardener and the handyman are not both lying; and if the handyman is telling
the truth then the cook is lying. For each of the four witnesses, can the detective
determine whether that person is telling the truth or lying? Explain your
reasoning
14. Four friends have been identified as suspects for an unauthorized access into
a computer system. They have made statements to the investigating authorities.
Alice said,“Carlos did it.” John said, “I did not do it.” Carlos said, “Diana did it.”
Diana said, “Carlos lied when he said that I did it.”
• a) If the authorities also know that exactly one of the four suspects is telling the
truth, who did it? Explain your reasoning.
• b) If the authorities also know that exactly one is lying, who did it? Explain your
reasoning.
• 15. Find a compound proposition involving the propositional variables p, q,
and r that is true when exactly two of p, q,and r are true and is false
otherwise. [Hint: Form a disjunction of conjunctions. Include a conjunction
for each combination of values for which the compound proposition is true.
Each conjunction should include each of the three propositional variables or
its negations.]
• 16. Suppose that a truth table in n propositional variables is specified. Show
that a compound proposition with this truth table can be formed by taking
the disjunction of conjunctions of the variables or their negations, with one
conjunction included for each combination of values for which the compound
proposition is true. The resulting compound proposition is said to be in
disjunctive normal form.
17. A collection of logical operators is called functionally complete if every
compound proposition is logically equivalent to a compound proposition
involving only these logical operators.
Show that ¬ and ∧ form a functionally complete collection of logical operators.
[Hint: First use a De Morgan law to show that p ∨ q is logically equivalent to ¬ ( ¬
p ∧ ¬ q).]
18. Use truth tables to establish which of the statement forms in
are tautologies and which are contradictions.
• a. (p ∧ q) ∨ (∼p ∨ (p ∧ ∼q))
• b. (p ∧ ∼q) ∧ (∼p ∨ q)
• c. ((∼p ∧ q) ∧ (q ∧ r ))∧ ∼q
• d. (∼p ∨ q) ∨ (p ∧ ∼q)
• 19. below, a logical equivalence is derived from Theorem TABLE 6 Logical
Equivalences, Supply a reason for each step.
a) (p ∧ ∼q) ∨ (p ∧ q) ≡ p ∧ (∼q ∨ q) by (a)
≡ p ∧ (q ∨ ∼q) by (b)
≡ p ∧ t by (c)
≡ p by (d)
Therefore, (p ∧ ∼q) ∨ (p ∧ q) ≡ p.
b) (p ∨ ∼q) ∧ (∼p ∨ ∼q) ≡ ∼q
≡ (∼q ∨ p) ∧ (∼q ∨ ∼p) by (a)
≡ ∼q ∨ (p ∧ ∼p) by (b)
≡ ∼q ∨ c by (c)
≡ ∼q by (d)
Therefore, (p ∨ ∼q) ∧ (∼p ∨ ∼q) ≡ ∼q.
20. Use truth tables to establish the truth of each statement .
a. A conditional statement is not logically equivalent to its converse.
b. A conditional statement is not logically equivalent to its inverse.
c. A conditional statement and its contrapositive are logically equivalent to each
other.
d. The converse and inverse of a conditional statement are logically equivalent to
each other.
21.(a) use the logical equivalences p →q ≡∼p ∨ q and p ↔ q ≡ (∼p ∨ q) ∧
(∼q ∨ p) to rewrite the given statement forms without using the symbol → or
↔, and
(b) use the logical equivalence p ∨ q ≡∼(∼p∧ ∼q) to rewrite each statement
form using only ∧ and ∼.
(i) p ∧ ∼q →r
(ii) p ∨ ∼q →r ∨ q
(iii) (p →r ) ↔ (q →r )
(iv) (p → (q →r )) ↔ ((p ∧ q) →r )
22. a) Design a circuit to take input signals P, Q, and R and output a 1 if,
and only if, P and Q have the same value and Q and R have opposite
values.
• b) Design a circuit to take input signals P, Q, and R and output a 1 if,
and only if, all three of P, Q, and R have the same value.
23. Application of logic in Logic Circuits
24. Application of logic in Logic Puzzles
25. Application of logic in Boolean Searches
26. Application of logic in System Specifications
27. Application of logic Translating English Sentences
• 28. Construct a truth table for each of these compound propositions.
• a) p → ¬ q b) ¬ p ↔ q
• c) (p → q) ∨ ( ¬ p → q) d) (p → q) ∧ ( ¬ p → q)
• e) (p ↔ q) ∨ ( ¬ p ↔ q)
• f ) ( ¬ p ↔ ¬ q) ↔ (p ↔ q)
• g) (p ∨ q) ∨ r h) (p ∨ q) ∧ r
• i) (p ∧ q) ∨ r j) (p ∧ q) ∧ r
• k) (p ∨ q) ∧ ¬ r l ) (p ∧ q) ∨ ¬ r
29. (i) Construct a truth table for each of these compound propositions.
• a) p → ( ¬ q ∨ r)
• b) ¬ p → (q → r)
• c) (p → q) ∨ ( ¬ p → r)
• d) (p → q) ∧ ( ¬ p → r)
• e) (p ↔ q) ∨ ( ¬ q ↔ r)
• f ) ( ¬ p ↔ ¬ q) ↔ (q ↔ r)
• (g) ((p → q) → r) → s.
• (h) (p ↔ q) ↔ (r ↔ s).
• 30. Do question number 19

You might also like