0% found this document useful (0 votes)
10 views2 pages

Comsc 80 Homework 2

Dnjb

Uploaded by

2cdg5bbkvm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Comsc 80 Homework 2

Dnjb

Uploaded by

2cdg5bbkvm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

(2 points)
Study “Short Circuit” Evaluation. Be sure to watch the video and read the post.
Write a paragraph describing short circuit evaluation. Include advantages of short
circuit evaluation.

Short circuit evaluation is a logical evaluation strategy used in programming and


mathematics. It involves evaluating the operands of a logical expression from left to
right and stopping as soon as the outcome of the entire expression is known. Short-
circuit evaluation is a programming concept that stops evaluating an expression when
the result is known. With logical AND, if the first part is false, it stops. With OR, if the
first part is true, it stops. This saves time and can prevent errors, like division by zero.

2. (2 points)
Write the negation of the statement “The computer is broken, or the computer is not
plugged in.” What is the name of the logical equivalence that you applied?

The negation of the statement "The computer is broken, or the computer is not plugged
in" is "The computer is not broken, and the computer is plugged in." This negation
follows the logical equivalence known as De Morgan's Law.

3. (2 points)
Study Example 2.1.7 and Example 2.3 in the text. Use a truth table to determine
whether (p∧q)→r≡(p→r)∧(q→r). Justify your conclusion in one sentence.

p q r (p^q)->r (p->r)^(q->r)

T T T T T

T T F F F

T F T T T

T F F T T

F T T T T

F T F T T

F F T T T

F F F T T
Both the expressions (p∧q)→r and (p→r)∧(q→r) have the same truth value for
all possible combinations of the truth values of p, q and r. Therefore, (p∧q)→r
≡ (p→r)∧(q→r).

4. (1 point)
True or False: The statements “If Earl studied, then Earl received an A.” and “If Earl
received an A, then Earl studied.” are logically equivalent.

False. The statements "If Earl studied, then Earl received an A" and "If Earl received an
A, then Earl studied" are not logically equivalent. They represent different logical
relationships.

5. (1 point)
True or False: The statements “If Earl studied, then Earl received an A.” and “If Earl did
not receive an A, then Earl did not study.” are logically equivalent.

True. The statements "If Earl studied, then Earl received an A" and "If Earl did not
receive an A, then Earl did not study" are logically equivalent. Both statements convey
the idea that studying is a necessary condition for receiving an A.

6. (2 points)
Write the negation of the statement “If Earl studied, then Earl received an A.”

The negation of the statement "If Earl studied, then Earl received an A" is "Earl studied,
but he did not receive an A."

7. (3 points)
Write the converse, inverse, and contrapositive of the statement “If Popeye is a
Dachshund, then Popeye has short legs.” Your statements should be written in English
form.

Converse: "If Popeye has short legs, then Popeye is a Dachshund."

Inverse: "If Popeye is not a Dachshund, then Popeye does not have short legs."

Contrapositive: "If Popeye does not have short legs, then Popeye is not a Dachshund."

You might also like