Answer to Question #147337 in Discrete Mathematics for Hammad

Question #147337
) We have the following set of information about a computer program, find the mistake in the program using Rules of Inferences.
i. Either a variable is not declared or there is a syntax error in the fifth line.
ii. If there is a syntax error in the fifth line, then there is a missing semicolon or there is a mistake in variable name.
iii. There is not a missing semicolon.
iiii. There is a mistake in variable name.
1
Expert's answer
2020-11-30T13:32:34-0500

p = there is an undeclared variable

q = there is a syntax error in the first five lines

r = there is a missing simicolon

s = there is a misspelled variable name

We can then translate the four given sentences as:

i. p "\\lor" q

ii. q →(r "\\lor" s)

iii. ~ r

iiii. ~ s

Now we will assume that the previous four premises are true and derive a conclusion using rules of inference.

Step (reason)

1. p "\\lor" q (premise)

2. q →(r "\\lor" s) (premise)

3. ~ r (premise)

4. ~ s (premise)

5. ~ r "\\land" ~ s (conjunction of (3) and (4))

6. ~ (r "\\lor" s) (De Morgan’s Law of (5))

7. ~ q (Modus tollens of (2) and (6))

8. p (elimination of (1) and (7)

We have derived in step (8) that p is true and thus there is an undeclared variable.

Answer: There is an undeclared variable.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS