About

Logic

Column

Logical Operations

Logical Operations

  • \(\neg p\) the negation of proposition \(p\).
  • \(p \wedge q\) Both propositions p and q are simultaneously true (Logical State AND)
  • $p q $ One of the propositions is true, or both (Logical State : OR)
  • \(p \otimes q\) Only one of the propositions is true (Logical State : exclusive OR (i.e XOR)

Propositions

Propositions

The negations of a proposition, Compound Statements, Truth tables

logical implication

logical implication

%- http://whatis.techtarget.com/definition/logical-implication

Logical implication is a type of relationship between two statements or sentences. The relation translates verbally into “logically implies” or “if/then” and is symbolized by a double-lined arrow pointing toward the right ( \(\rightarrow\)). If A and B represent statements, then \(A\rightarrow B\) means “A implies B” or “If A, then B.” The word “implies” is used in the strongest possible sense.

As an example of logical implication, suppose the sentences A and B are assigned as follows:

  • A = The sky is overcast.
  • B = The sun is not visible.
In this instance, A B is a true statement (assuming we are at the surface of the earth, below the cloud layer.) However, the statement B A is not necessarily true; it might be a clear night. Logical implication does not work both ways.

However, the sense of logical implication is reversed if both statements are negated. That is,

\[(A \rightarrow B) \equiv (-B \rightarrow -A)\]

Using the above sentences as examples, we can say that if the sun is visible, then the sky is not overcast. This is always true. In fact, the two statements A B and -B -A are logically equivalent.

Conditional Connectives

Column

Conditional Connectives

Conditional Connectives

Logic Networks

Column

Logic Networks

AND and OR Gates

“AND and OR”
“AND and OR”

Logic - Worksheet 1

Column

Work Sheet 1

Question 1

Let \(n \in \{1,2,3,4,5,6,7, 8 ,9\}\) and let \(p,q\) be the following propositions concerning the integer \(n\).

Find the values of n for which each of the following compound statements is true.

[(i)] \(\neg p\) [(ii)] \(p \wedge q\) [(iii)] \(\neg p \vee q\) [(iv)] $ p q$.

Question 2

Let p and q be propositions.

[(i)] Construct the truth table for \(p \rightarrow q\). [(ii)] Use truth tables to prove that \(\neg q \rightarrow \neg p\) = \(p \rightarrow q\).

[(c)] Let \(p\), \(q\) be the following propositions:

p : this apple is red, q : this apple is ripe.

Express the following statements in words as simply as you can.

[(i)] \(p \rightarrow q\) [(ii)] \(p \wedge \neg q\).

### Conditional Connectives
#### Question 4
Write the contrapositive of each of the following statements:
* If n= 12, then n is divisible by 3. * If n=5, then n is positive. * If the quadrilateral is square, then four sides are equal.
#### Solutions
* If n is not divisible by 3, then n is not equal to 12. * If n is not positive, then n is not equal to 5. * If the four sides are not equal, then the quadrilateral is not a square.
Let \(n \in \{1,2,3,4,5,6,7, 8 ,9\}\) and let \(p,q\) be the following propositions concerning the integer \(n\).
* \(p\): \(n\) is even * \(q\): \(n < 5\).
Find the values of n for which each of the following compound statements is true.
a. \(\neg p\) b. \(p \wedge q\) c. \(\neg p \vee q\) d. $ p q$.

Exercise

Let \(n = \{1, 2,3,4, 5,6,7, 8, 9\}\) and let \(p\) and \(q\) be the following propositions concerning the integer \(n\).

  • p: n is even,
  • q: \(n\geq 5\).

By drawing up the appropriate truth table find the truth set for each of the propositions \(p \vee \neg q\) and $ q p$


Exercise

Let p, q be the following propositions:

\(p\) : this apple is red, \(q\) : this apple is ripe.

Express the following statements in words as simply as you can:

  1. \(p \rightarrow q\)
  2. \(p \wedge \neg q\).

Express the following statements symbolically:

  1. This apple is neither red nor ripe.
  2. If this apple is not red it is not ripe.

Question

Let p and q be propositions.

  1. Construct the truth table for \(p \rightarrow q\).
  2. Use truth tables to prove that \(\neg q \rightarrow \neg p\) = \(p \rightarrow q\).

Truth Table - Worksheet 2

Column

Work Sheet 3 - Truth Table Questions

{Section 3 Logic}


{Conditional Connectives}

Construct the truth table for the proposition \(p \rightarrow q\).

\[ \begin{table}{|c|c|c|c|} \hline p & q & $p \rightarrow q$ & $q \rightarrow p$ \\ \hline 0 & 0 & 1& 1 \\ 0 & 1 & 1 & 0 \\ 1 & 0 & 0 & 1 \\ 1 & 1 & 1 & 1 \\ \hline \end{table}\]

Logic Networks - Worksheet 2

Column

Work Sheet 3 - Logic Networks

Question 1

Construct a logic network that accepts as input p and q, which may independently have the value 0 or 1, and gives as final input \(\neg(p \wedge \not q)\) (i.e. \(\equiv p \rightarrow q\)).\

Logic Gates

  • AND
  • OR
  • NOT

Question 2

Construct a logic network that accepts as input p and q, which may independently have the value 0 or 1, and gives as final input \((p \wedge q) \vee \neg q\) (i.e. \(\equiv p \rightarrow q\)).

Important Label each of the gates appropriately and label the diagram with a symblic expression for the output after each gate.

Question 3

Construct a logic network that accepts as input p and q, which may independently have the value 0 or 1, and gives as final input \(\neg(p \wedge \not q)\) (i.e. \(\equiv p \rightarrow q\)).

  • Use to prove that the following statements are equivalent to one another.

\[(p \vee q) \wedge \neg q \qquad \equiv \qquad p\wedge \neg q.\]


Construct a logic network that accepts as input \(p\) and \(q\), which may independently have the value 0 or 1, and gives as final input \((p \wedge q) \vee \neg q\) (i.e. \(\equiv p \rightarrow q\)).

Important Label each of the gates appropriately and label the diagram with a symblic expression for the output after each gate.