DS Assignment-1 Solution
DS Assignment-1 Solution
Solution:
It’s easiest to use symbolic notation. Then we have the following five propositions.
1. K ∨ H.
2. R ⊕ W .
3. A → R.
4. W ↔ K.
5. H → A ∧ K.
There are many ways to proceed. Here’s one. Note that 1 and 5 both involve K and H. 1 says either K
or H, but 5 says that if H, then also A ∧ K, so K in that case, too. Thus, H occurs whenever K occurs, so
in all cases K. Now 1 is satisfied. So we now know K. By 4, therefore also W, and 4 is now satisfied. By
2, therefore ¬R, and 2 is satisfied. Then by 3, therefore ¬A, and 3 is satisfied. But by 5, since ¬A,
therefore ¬H, and 5 is satisfied. By now, we’ve satisfied all five statements in the only way possible,
namely, with K, W , but not R, not A, and not H. Thus, the answer to the question is: we can conclude
that Kamal and Waqas are chatting, but the other three aren’t.
Another way is to make truth table of whole scenario and find the values where all 5 propositions
are true.
Q.2. Translate the given statement into propositional logic. (5+5 marks)
Solution:
a. You cannot edit a protected Wikipedia entry unless you are an administrator. Express your
answer in terms of e: “You can edit a protected Wikipedia entry” and a: “You are an
administrator.”
Lets consider p→q. Another way to express this implication is q unless ∼p.
Now coming to this problem: Whenever there is unless in the statement, remove it and put NOT to
the statement after it. e.g: You cannot edit a protected Wikipedia entry unless you are an
administrator. You cannot edit a protected Wikipedia entry, you are NOT an administrator. Now,
1. Above 35 years
2. Born in USA or Parents were in USA
3. lived above 14 years
As they have to be satisfied together so AND operator is to be used. So the answer is
(a^(bvp)^r)→e
Q.3. 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.”
Solution:
p = "The message is scanned for viruses"
q = "The message was sent from an unknown system"
Solution:
1. The negation of “Kamal will take a job in industry or go to graduate school” is “Kamal will not take
a job in industry and will not go to graduate school,” or “Kamal will neither go to industry nor go to
graduate school.”
2. The negation of “Yusuf knows Java and calculus” is “Yusuf does not know Java or does not know
calculus,” or (more naturally, though ignoring De Morgan’s Law) “Yusuf does not know both Java and
calculus.” The answer “Yusuf does not know Java or calculus” is incorrect, as this implies that Yusuf
knows neither. Because of the structure of English sentences, you cannot negate the proposition
simply by switching “does” with “does not” and “and” with “or.”
3. The negation of “Junaid is young and strong” is “Junaid is not young or not strong.” The answer
“Junaid is not young or strong” is incorrect since this implies that he is neither.
4. The negation of “Raheem will move to Oregon or Washington” is “Raheem will not move to
Oregon and will not move to Washington.” The answer “Raheem will not move to Oregon and
Washington” is incorrect, since this implies that she will not move to both states where we want to
say that she will not move to either.
a) Neither Kamal will take a job in industry nor will he go to graduate school.
b) Either Yusuf does not know Java or he does not know calculus.