<< Chapter < Page Chapter >> Page >

For each of the following, find a satisfying truth assignment, (values of the propositions which make the formula true),if any exists.

  1. a b a
  2. a c b a b
Got questions? Get instant answers now!

For each of the following, find a falsifying truth assignment, (values of the propositions which make the formula false),if any exists.

  1. a b a
  2. b a c a b
Got questions? Get instant answers now!

Formula φ is stronger than formula ψ if ψ is true whenever φ is true ( i.e. , φ is at least a strong as ψ ), but not conversely. Equivalently, this means that φ ψ is always true, but ψ φ is not always true.

As one important use of this concept, if we know that ψ θ , and that φ is stronger than ψ , then we also know that φ θ . That holds simply by transitivity.Another important use, which is outside the scope of this module, is the idea of strengthening an inductive hypothesis.

Similarly, φ is weaker than formula ψ whenever ψ is stronger than φ .

Show which of the following hold. When true, show φ ψ is true by a truth table, and show a falsifying truth assignment for ψ φ . When false, give a truth table and truth assignment the other wayaround.

  1. a b is stronger than a b .

  2. a b is stronger than a .

  3. a is stronger than a b .

  4. b is stronger than a b .

Got questions? Get instant answers now!

Using truth tables, show that a c b c c a is equivalent to b c a . but not equivalent to a c b c .

Got questions? Get instant answers now!

[Practice problem solution provided.]

When writing a complicated conditional that involves multiple pieces of data, it is easy to incorrectly oversimplify.One strategy for avoid mistakes is to write such code in a two-step process.First, write a conditional with a case for every possible combination, as in a truth table. Second, simplify the conditional.

Using this approach, we might obtain the following code after the first step. Simplify this code.

list merge_sorted_lists(list list1, list list2) {if (is_empty(list1)&&is_empty(list2)) return empty_list;else if (is_empty(list1)&&!is_empty(list2)) return list2;else if (!is_empty(list1)&&is_empty(list2)) return list1;else if (!is_empty(list1)&&!is_empty(list2)) { if (first_element(list1)<first_element(list2)) return make_list(first_element(list1),merge_sorted_lists(rest_elements(list1),list2)); else if (first_element(list1)>= first_element(list2)) return make_list(first_element(list2),merge_sorted_lists(list1,rest_elements(list2))); }}
list merge_sorted_lists(list list1, list list2) {if (is_empty(list1)) return list2;else if (is_empty(list2)) return list1;else { if (first_element(list1)<first_element(list2)) return make_list(first_element(list1),merge_sorted_lists(rest_elements(list1),list2)); elsereturn make_list(first_element(list2),merge_sorted_lists(list1,rest_elements(list2))); }}

Alternatively, we could test the emptiness of the lists in the other order.

Got questions? Get instant answers now!

Consider the following conditional code, which returns a boolean value.

int i; bool a,b;… if (a&&(i>0)) return b;else if (a&&i<= 0) return false;else if (a || b) return a;else return (i>0);

Simplify it by filling in the following blank with a single Boolean expression.Do not use a conditional (such as if or ?: ).

int i; bool a,b;… return ________________;

Use either Java/C++ or Scheme syntax. In the former case, please fully parenthesize to make yourformula unambiguous, rather than relying on Java's or C++'s many levels of operator precedence.

Got questions? Get instant answers now!

Reasoning with equivalences

[Practice problem solution provided.]

Using algebraic identities , and the definition or nor (mnemonic:

not or
), written , φ ψ φ ψ , express the function ∧ in terms of only. That is, give a formula which doesn't use ∧, ∨, ¬, butinstead only uses and which has the same truth table as φ ψ .

First we show that we can write negation in terms of , or more specifically, θ θ θ . Checking this on a truth table is pretty easy(there are only two rows to check). But for this question we need to use algebraic manipulation.This can be derived in a couple of simple steps:

1 θ
2 θ θ Idempotency of ∧
3 θ θ DeMorgan's law
4 θ θ Definition of nor

We use this lemma to show our ultimate goal:

1 δ ε
2 δ ε Double Complementation
3 δ ε DeMorgan's law
4 δ δ ε Lemma, with [ θ δ ]
5 δ δ ε ε Lemma, with θ ε
6 δ δ ε ε Definition of nor, where φ δ δ , and ψ ε ε

Note that we judiciously used new meta-variables δ and ε rather than re-using φ and ψ (which would still be correct, but would make the graders need to pay much closer attention to the scope of those variables).

Got questions? Get instant answers now!

Similar to the previous exercise, express each of the following using nand only, and prove correctness using the algebraic identities .

This operation is particularly interesting, since making a NAND gate in hardware requires only two transistors.

  1. ¬
Got questions? Get instant answers now!

Using algebraic identities , show that a c b c c a is equivalent to b c a .

This is an algebraic hand-evaluation: a series of formulas joined by . Don't write just portions of previous formulasand mysteriously re-introduce the dropped parts later. For each step, mention which identity you used.It is also helpful if you underline the formula you are rewriting in the next step.You can use commutativity and associativity without using a separate line, but mention when you use it.

Got questions? Get instant answers now!

In two exercises, you've shown the same equivalence by truth tables and by algebraic identities .

  1. What is an advantage of using truth tables? What is an advantage of using identities?

  2. In that truth table exercise , you also showed twoformulas φ and ψ non -equivalent. It is also possible to do so with Boolean algebra ratherthan truth tables. How?

  3. Describe a hybrid approach, combining truth tables and Boolean algebra, to prove the equivalence and non-equivalence of formulas.

  4. To ponder on your own without turning it in: Which approach appeals more to you?

Got questions? Get instant answers now!

Using algebraic identities , rewrite the formula a b c b to one with fewer connectives.

Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Intro to logic. OpenStax CNX. Jan 29, 2008 Download for free at http://cnx.org/content/col10154/1.20
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Intro to logic' conversation and receive update notifications?

Ask