Computer Science, asked by horasinghgurmeet, 8 months ago

Given the following code :- [2]

im = (p==q) ? (p*p) : (q*2);

What will be the value of im if :-

(i) p=6 and q=6

(ii) p=10 and q=12​

Answers

Answered by Nathalie14
2

Answer:

This particular equivalence is known as De Morgan's Law. Since columns corresponding to p∨(q∧r) and (p∨q)∧(p∨r) match, the propositions are logically equivalent. This particular equivalence is known as the Distributive Law.

Explanation:

Definition 2.1.1. A tautology is a proposition that is always true.

Example 2.1.1. p ∨ ¬p

Definition 2.1.2. A contradiction is a proposition that is always false.

Example 2.1.2. p ∧ ¬p

Definition 2.1.3. A contingency is a proposition that is neither a tautology

nor a contradiction.

Example 2.1.3. p ∨ q → ¬r

Discussion

One of the important techniques used in proving theorems is to replace, or substitute, one proposition by another one that is equivalent to it. In this section we will

list some of the basic propositional equivalences and show how they can be used to

prove other equivalences.

Let us look at the classic example of a tautology, p ∨ ¬p. The truth table

p ¬p p ∨ ¬p

T F T

F T T

shows that p ∨ ¬p is true no matter the truth value of p.

[Side Note. This tautology, called the law of excluded middle, is a

direct consequence of our basic assumption that a proposition is a

statement that is either true or false. Thus, the logic we will discuss

here, so-called Aristotelian logic, might be described as a “2-valued”

logic, and it is the logical basis for most of the theory of modern

mathematics, at least as it has developed in western culture. There

is, however, a consistent logical system, known as constructivist,

or intuitionistic, logic which does not assume the law of excluded

middle. This results in a 3-valued logic in which one allows for

Similar questions