Skip to content Skip to navigation Skip to collection information

Connexions

You are here: Home » Content » Intro to Logic » the limitations of truth tables

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • Rice Digital Scholarship

    This collection is included in aLens by: Digital Scholarship at Rice University

    Click the "Rice Digital Scholarship" link to see all content affiliated with them.

Recently Viewed

This feature requires Javascript to be enabled.
 

Are we done yet?

Are we done with propositional logic, now that we can test for equivalence and tautologies, using truth tables? Possibly. Truth tables can answer any question about propositional logic, but not always conveniently.

Consider the following code:


bool do_something(int value)
{
   bool a = …;
   bool b = …;

   if (a && !b)
      return true;
   else if (!a && !b)
      return false;
   else if (a)
      return a;
   else if (b)
      return false;
   else
      return true;
}

Clearly, this is very ugly and should be simplified. But to what? We could build a truth table for the corresponding WFF, but so far we don't have any better way of finding a simpler equivalent formula than testing equivalence with whatever comes to mind. We need some way to generate formulas, given either an equivalent formula or a truth table.

There is another practical difficulty with truth table: they can get unwieldy.

Exercise 1

How many rows are there in a truth table with 2 input variables? 3 variables? 5 variables? 10 variables? nn variables?

Solution

  • 2 variables: As we're seen, 4 rows.
  • 3 variables: 8 rows.
  • 5 variables: 32 rows.
  • 10 variables: 1024 rows.
  • nn variables: 2n 2 n rows.

Exercise 2

(Optional) Now, how many such boolean functions are possible, with 2 inputs? With 3? For fun, sit down and name all the possible two-input functions. You'll find that some of them are rather boring, such as the constant function true, and many are just permutations on .

Solution

  • With 2 variables, we have 4 rows. How many different ways can we assign true and false to those 4 positions? If you write them all out, you should get 16 combinations.
  • With 3 variables, we have 8 rows and a total of 256 different functions.
  • With nn variables, we have 2n 2 n rows and a total of 22n 2 2 n different functions. That's a lot!

When discussing a circuit with 100 wires (each corresponding to a single proposition), truth tables are clearly infeasible. Modern processors have millions of wires and transistors. It is still an area of active research to cope with such a huge number of possibilities. (The key idea is to break things down into small sections, prove things about the small sections, and hopefully have a small set of sentences formally capturing the interface between sections.)

So truth tables are intractable for analyzing circuits of more than a few wires. But will they suffice for answering WaterWorld questions? Image a (large) table with all the neighbor propositions: A-has-0A-has-0, B-has-0B-has-0, …, A-has-1A-has-1, B-has-1B-has-1, … Now, determine which rows which entail B-safeB-safe. To answer this, we end up looking at rows involving many clearly-irrelevant propositions such as Z-has-2Z-has-2.

Aside:

Hmm, considering every possible board and then counting what proportion of boards entail B-safeB-safe — hmm, this is the brute-force definition of probability! Since such truth tables enumerates all possible boards, it's like looking for probability 1 the brute-force way.

Also, this method of playing WaterWorld via huge truth tables would be unsatisfying for another reason: it doesn't actually reflect our own reasoning. As a general principle of programming, your program should always reflect how you conceive of the problem. The same applies to logic.

Aside:

Consider the difference between using truth tables and actually reasoning. The philosopher Bertrand Russell, trying to pin down what exactly constitutes “knowledge”, suggested that he knows that the last name of Britain's prime minister begins with a 'B'. While Gordon Brown is prime minister, making Bertrand is correct, we hesitate to say he actually knows the fact — he wrote his example when the prime minister was Arthur Balfour (1902-1905). So while he is correct in a truth-table sense, his reasoning isn't, and we tend to say that he does not actually know the prime minister's last initial.

So, no: we're not yet finished with propositional logic. We want to look for (hopefully) more feasible ways to determine whether a formula is a tautology (or, whether two formulas are equivalent). As a clue, we'll try to discover methods which are based on the way we naively approach this. We'll look first at equivalences, and then at inference rules.

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add:

Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks