Formal Logic

Logic is a formal system that was invented by mathematicians and philosophers to set up rules for how we should prove or disprove things. The purpose of formal logic is to help us to construct valid arguments (or proofs) and to judge whether the arguments (or proofs) of others are valid. Another major use of formal logic is computer languages and digital circuits. All electronic hardware and all computer programs are based on the rules of formal logic.

We will give a formal definition of an argument later, but in order to begin by getting a sense of the purpose of formal logic, we will give some informal examples here. An argument is simply a sequence of statements, or a sequence of sentences so that each sentence asserts a fact about something and each sentence is either true or false (for a complete explanation of what a statement is and some examples, see the next section of this lecture).

The last statement given in an argument (which always begins with the word "therefore" when we write up the argument formally) is called the conclusion, and all other statements in the argument are called the premises.

Here are some examples of arguments:

Example 1:

If the subway is delayed today, I will be late to class. (premise)

If I am late to class today, I will lose 10 points from my homework grade. (premise)

The subway is delayed today. (premise)

Therefore, I will lose 10 points on my homework today. (conclusion)

Example 2:

2x < 2. (premise)

x > −1. (premise)

Therefore, −1 < x < 1. (conclusion)

 

Our first example here is an argument about everyday things, and our second example is an argument about mathematics. More complicated arguments may be built by taking several simple arguments and putting them together, often so that the conclusions of one simple argument become one of the premises of the next simple argument.

Valid vs Invalid Arguments

When we listen to or read the arguments of others, we want to be able to evaluate whether or not the argument that they are making actually works. There are 2 basic ways in which an argument can fail:

  1. one or more of the premises are actually false

  2. the structure of the argument is invalid
    (We say that an argument is valid if the conclusion of the argument is true whenever all of the premises are true.)

If one or more of the premises of an argument is false, then it doesn't matter how good the structure of the argument is, because we can only assume that the conclusion is true if all of the premises are true.

Here is an example of an argument that has a valid structure, but where we cannot assume that the conclusion is true because one of the premises is false:

Example Argument 1: (valid structure with false premise)

For the sake of this argument, we will assume that it is actually January.

If is it October, then classes are in session.

It is October.

Therefore classes are in session.

The structure of this argument is valid: If classes are always in session during October and if it actually is October, then it is clear that we can conclude that classes are in session.

However, if it is currently January (as we have been instructed to assume here), then it cannot also be October, so the second premise of this argument is actually false. So we cannot assume that classes are actually in session; it may be that classes are in session, or it may be that classes are not in session. This argument, even though it has a valid structure, fails because at least one of its premises are false, and therefore the conclusion is not guaranteed to be true. An argument with a valid structure only guarantees that the conclusion is true if all the premises of the argument are true.

On the other hand, if the structure of the argument is invalid, then it doesn't matter whether or not any of the premises are true, because we can only assume that the conclusion is true if if the reasoning that takes us from the premises to the conclusion is sound.

Here is an example of an argument that has true premises but a false conclusion because the structure of the argument is invalid - in other words, the conclusion does not follow logically from the premises:

Example Argument 2: (true premises but false conclusion resulting from invalid structure)

For the sake of this argument, we will assume that it is actually the end of January and that classes are currently in session.

If is it October, then classes are in session.

Classes are in session.

Therefore it is October.

The structure of this argument is invalid. The problem is this: the first premise tells us that if it is October, then we can conclude that classes are in session, but it does not tell us that if class are in session then it must be October. In fact, if classes are in session, it could be any number of other months: September, or May, for example. So our conclusion that it is October does not logically follow from our two premises.

Our two premises are actually true: based on what we have been told to assume in this problem, it is true that classes are always in session in October, and it is true that classes are currently in session. But since it is currently January, then it cannot also be October, so the conclusion of this argument is actually false. The reason that true premises can lead to a false conclusion in this case is that our line of reasoning doesn't make sense; that is, our argument is invalid. The structure of our logical reasoning contains a flaw.

So, to determine whether or not a particular argument holds, we have to check two things:

  1. We need to check if all the premises are actually true.
  2. And we need to check if the structure of the argument is valid.

Checking whether or not the premises are true is relatively easy, but checking to see if the structure of the argument is valid can be much more difficult, especially for any argument with a really complex structure.

For example, can you tell whether or not the structure of the following argument is valid?

Example Argument 3: (complex argument for which it is difficult to tell whether it is valid or invalid)

I have a passing grade in this class.

I did not turn in any homework late and I passed all the tests.

I am failing my chemistry class or this class.

Therefore, it is false that I am failing chemistry, only if I turned in some of my homework late.

This argument, it turns out, does in fact have a valid structure, even though it sounds like nonsense. But it is practially impossible to tell just from looking at the words. In order to come to the conclusion that this argument has a valid structure, we first need to find a way to describe the abstract structure of this argument, free from the complicated phrases included in this particular argument. Then we need a systematic way to check every possible combination of events to see if all cases in which all three premises are true are also cases in which the conclusion is true.

This is what motivates our mathematical study of formal logic: we want to find a way to evaluate the structure of arguments, free from their complicated specific details. So, the first thing we want to do is to find a way to write down the structure of an arguement in an abstract way.

In order to do this, we first begin by learning a few formal definitions. We begin by giving the formal definition of a statement.

What is a statement?

A statement is a sentence that is either true or false. Statements are sentences about facts. If a sentence expresses an opinion about something instead of a verifiable fact about something, then it is not a statement. If a sentence is unclear enough that it would be impossible to determine whether or not it is true, then it is not a statement. If a sentences express commands or gives directions, it is not a statement. Let's look at some examples to better understand which sentences would be statements and which would not:

Representing Complex Statements as a Combination of Simple Statements:

The examples of statements given above were all simple statements, which means that they are statements which cannot be broken down into simpler statements . However, we can compound statements, which are statements that are composed of one or more simple statements using some connecting words. For example, here are some compound statements:

  1. It rains only if there are clouds in the sky.

  2. My mother was not from Australia, but my grandmother was from Australia.

  3. A number is divisible by 6 if and only if it is divisible by 2 and 3.

  4. All cows eat grass, and grass only grows in areas with a temperate climate, so there are no cows in areas with climates that are not temperate.

Trying to judge when these more complicated statements are true or false can be difficult, because they have so many different parts to which we must pay attention. If we look closely, we can see that each of these compound statements could be broken down into several simple statements joined together by some special words:

  1. It rains only if there are clouds in the sky.
    This statement is composed of the statements "It rains" and "There are clouds in the sky." The extra words which join these two statments together are the words "only if."

  2. My mother was not from Australia, but my grandmother was from Australia.
    This statement is composed of the simple statements "My mother was from Australia" and "My grandmother was from Australia." The first simple statement has been modified by the use of the word "not" and the two simple statements have been joined by the word "but"

  3. A number is divisible by 6 if and only if it is divisible by 2 and 3.
    This statement is composed of the simple statements "A number is divisible by 6," "A number is divisible by 2," and "A number is divisible by 3." The extra words which joint these statements together are the words "and" and "if and only if."

  4. All cows eat grass, and grass only grows in areas with a temperate climate, so there are no cows in areas with climates that are not temperate.
    This statement is actually so complex that we will leave it for later; it is actually a combination of 4 simple statements, joined by 6 different groups of words. We will break down this statement in an example later in the lecture once we have learned a bit more about how to translate statements into symbols which represent their structure.

We often represent statments with lowercase letters: for example, some of the most comonly used letters in logic are the letters p, q, and r. (Note: In mathematics, a lowercase letter and an uppercase letter are assumed to represent different things. So, for example, the variable p is not the same as the variable P.)

So, for example, the statement "It is raining" could be represented by the letter p. This means that anytime I want to refer to the statement "It is raining," I can instead just refer to the statement p, which is shorter.

Truth Values

Every statement has what we would call a truth value. The truth value of a statement is always either "true", which we often symbolize with T, or "false", which we often symbolize with F. So if the statement p is true, then its truth value is "true", and we might write:

p=T

And if the statement q is false, then its truth value is "false", and we might write:

q=F

 

Using Logical Connectives to Join Simple Statements

We noticed when we looked at some compound statements earlier in this lecture that putting simpler statements together to form compound statements requires the use of some important connecting words. We refer to these connecting words as logical connectives. An important question we must ask is this: how many different kinds of logical connectives are there?

So far we have seen lots of different words which can be used as logical connectives, but how do we know that all of these words are different? In the English language, we have lots of different words which mean essentially the same thing. In mathematical logic, we will only consider two logical connectives to be different if they give a compound sentence composed of the same simple sentences DIFFERENT TRUTH VALUES . When we actually talk in English sentences we use a wide range of words to give our sentences a different style or to convey our attitudes about what we are talking about, but in mathematical logic, we ignore all of these subtleties of language and try to concentrate only on whether something is true or false in a given situation.

The three essential logical coneectives are:

All compound logical statements can be written with only a combination of simple statements and these three logical connectives. Let's begin by learning about these three logical connectives, and then we can discuss some more complicated logical connectives which are constructed by using a combination of these 3 essential ones.

We can also represent our logical connectives with symbols. Below are definitions of each of the logical connectives listed above along with the symbol for the logical connective and examples of how it is used.

The Logical Connective "And":

And is symbolized by the symbol . The formal name for the word and is conjunction. If and joins the statements p and q, then it means that for pq to be true, both p must be true and q must be true.

Let's look at an example in words:

Let's look at the statement, "I will do all my homework and I will get an A on the test."

This is a compound statement because it is made up of 2 simple statements joined by the logical connective and. First we will break this down into two simple statements:

The first simple statement is, "I will do all my homework." We will call this statement p.

The second simple statement is, "I will get an A on the test." We will call this statement q.

So now we can rewrite this compound statement "I will do all my homework and I will get an A on the test," as pq.

When will the statement, "I will do all my homework and I will get an A on the test," be true?

I will only be telling the truth if p=T and q=T. In other words, I will only be telling the truth if it is true that I will do all my homework and it is true that I will get an A on the test. If I do all my homework but do not get an A on the test, or I get an A on the test but do not do all my homework, then I am lying when I say "I will do all my homework and I will get an A on the test," and the statement is false.

To sum up everything we have just said using symbols we could write:
T∧T=T
T∧F=F
F∧T=F
F∧F=F

Other words which can mean "and":

When we speak in English rather than formal logic, we sometimes use the word "but" instead of the word "and," particularly when we want to emphasize the contrast between the two statement we are joining. So, for example, the statement, "I passed the test but I failed the class, " really means, "I passed the test and I failed the class." The word "but" is just used instead of "and" to emphasize the contrast between passing the test and failing the class. In formal logic, we don't use words like "but" because they are purely for stylistic purposes. We always use the word "and" because it is simpler. Formal logic is only concerned with whether or not a specific statement is true; it is not concerned with emphasis or style.

Shortcuts for writing "and" statements in English:

Another thing we have to be careful of, it that often in English, if we have 2 statements joined by the word and, we eliminate part of the second statement if it is repetitive.

For example:

"Maria is short and Maria is blonde," becomes, "Maria is short and blonde."

So if we have the sentence, "The cake is moist and chewy," in order to put it into logical symbols we'd want to rewrite it to say. "The cake is moist, and the cake is chewy."

So if p="The cake is moist" and q="The cake is chewy", then the statement, "The cake is moist and chewy," could be written pq.

The Logical Connective "Or":

Or is symbolized by the symbol . The formal name for the word or is disjunction. If or joins the statements p and q, then it means that for pq to be true, either p must be true or q must be true or both p and q must be true.

This distinction is really important: In plain English, we often use the word or to mean "either...or," which means that either the first thing is true or the second thing is true, but not both. For example, if I say, "You will clean your room or you will be grounded," I mean either you will clean your room, or you will be grounded, but not both. If you clean your room I will not ground you. It is important to understand that in formal logic, which we are currently studying, the word or always means "the first thing or the second thing or both." An example of this in plain English would be if I said, "In order to pass you must make an A on the next test or you must make an A on the project. This means: If you make an A on the next test, you will pass. If you make an A on the project you will pass. If you make an A on both the next test and the project, you will pass. This example is a case in which either the first thing or the second thing or both must be true for the whole sentence to be true.

Again, remember that while in regular English we often use words in many different ways and depend upon context, or tone of voice to make our meaning clear, in formal logic, we make sure that words always have one and only one meaning; context and tone of voice never affect the meaning of a word.

Let's look at an example in words:

Let's look at the statement, "I will do all my homework or I will get an A on the test."

This is a compound statement because it is made up of 2 simple statements joined by the logical connective or. First we will break this down into two simple statements:

The first statement is, "I will do all my homework." We will call this statement p.

The second simple statement is, "I will get an A on the test." We will call this statement q.

So now we can rewrite this statement "I will do all my homework or I will get an A on the test," as pq.

When will the statement, "I will do all my homework or I will get an A on the test," be true?

I will only be telling the truth if p=T or q=T or both p=T and q=T. In other words, I will only be telling the truth if it is true that I will do all my homework or it is true that I will get an A on the test or it is true that I will both turn in all my homework and make an A on the test.

To sum up everything we have just said using symbols we could write:
T∨T=T
T∨F=T
F∨T=T
F∨F=F

Shortcuts for writing "or" statements in English:

Just as we have to be careful to see how statements contining the word and are written, we also have to be careful to recognise statments containing the word or. Just as with and, often in English, if we have 2 statements joined by the word or, we eliminate part of the second statement if it is repetitive.

For example:

"I need my passport or I need my drivers license," becomes, "I need my passport or drivers license."

So if we have the sentence, "Math 100 or Math 150 is required to graduate," in order to put it into logical symbols we'd want to rewrite it to say. "Math 100 is required to graduate or Math 150 is required to graduate."

So if p="Math 100 is required to graduate " and q="Math 150 is required to graduate ", then the statement, "Math 100 or Math 150 is required to graduate," could be written pq.

 

The Logical Connective "Not":

Not is symbolized by the symbol ~. The formal name for the word ~ is negation. If not comes in front of the statement p, then it means that for ~p to be true, p must be false. It's important to note that whenever p is true, ~p is false, and whenever p is false, ~p is true.

Let's look at an example in words:

Let's look at the statement, "It is not raining."

This is a compound statement because it is made up of 1 simple statement together with the logical connective not. First we will break this down into one simple statement:

The simple statement is, "It is raining." We will call this statement p.

So now we can rewrite this statement "It is not raining," as ~p.

When will the statement, "It is not raining," be true?

I will only be telling the truth if p=F. In other words, I will only be telling the truth if it is false that it is raining.

To sum up everything we have just said using symbols we could write:
~T=F
~F=T

More Complex Logical Connectives (Ones that can be replaced by a combination of "and," "or", and "not"):

1) The Logical Connective "If...then":

If...then is symbolized by the symbol . The formal name for the logical connective if...then is implication or the conditional. Sometimes we read pq as "p implies q" rather than "if p then q." When the conditional joins the statements p and q, it means that for pq to be true, whenever p is true, q must also be true; if p is false, the statement pq is true, no matter what the truth value of q is. This is really important: "the ONLY time pq is false is when p is true and q is false.

Let's look at an example in words:

Let's look at the statement, "If I get elected, then I will lower taxes."

This is a compound statement because it is made up of 2 simple statements joined by the logical connective if...then. First we will break this down into two simple statements:

The first statement is, "I get elected." We will call this statement p.

The second simple statement is, "I will lower taxes." We will call this statement q.

So now we can rewrite this statement "If I get elected, then I will lower taxes," as pq.

When will the statement, "If I get elected, then I will lower taxes," be true?

I will be telling the truth if p=T and q=T.

Or I will be telling the truth is p=F and q=(either T or F).

In other words, I will be telling the truth if it is true that I get elected and I lower taxes. Or I will be telling the truth if it is false that I get elected (and it can be either true or false that I lower taxes). I will only be lying if it is true that I get elected and it is false that I lower taxes. It is important to understand here that whenever p is false, p→q is true by default:

In formal logic, a statement is only false if it can be proved wrong. If there is no possible way to prove a statement false, then it is automatically true, or true by default. In terms of the example above, if I say, "If I get elected, then I will lower taxes," then no one can accuse me of lying if I never get elected. They can only accuse me of lying if I do get elected and don't lower taxes. My promise to lower taxes depends entirely on the condition that I get elected. If I never get elected, there is no possible way to prove that I would not have lowered taxes if I had been elected; so there is no way to prove that I was making a false statement. In order to prove that the statement, "If I get elected, then I will lower taxes," is false, someone would need to show that I did not lower taxes once elected. If I am never elected, then there is no way to show this.

Let's look at some more examples:

1) If you build it, then he will come.

This will be true if it is true that you build it and it is true that he comes. In other words, it will be true if it is both true that you build it and it is true that he comes.

If you do not build it, in other words, if it is false that you build it, then he may or may not come, and the statement, "If you build it, then he will come, " will still be true. Notice that the statment makes NO assertion about what will happen if you do NOT build it. It ONLY tells you what will happen if you DO build it. So there is no way to prove the statement false if you do not build it. The only way to prove this statement false is to build it and show that he does not come. If you do not build it (if it is false that you build it) then the statement, "If you build it he will come," is true by default.

2) If you eat your green beans, then you will get dessert.

This will be true if you eat your green beans and you get dessert. In other words, if it is true that you eat your green beans and it is true that you get dessert, then it is true that, "If you eat your green beans, then you will get dessert."

Notice again that the statement, "If you eat your green beans, then you will get dessert," does NOT tell you what will happen if you do NOT eat your green beans. In other words, it doesn't tell you what will happen if it is false that you eat your green beans. So if you do not eat your green beans, you never get to find out whether or not you would have gotten dessert if you had eaten them.

There is no way to prove that the statement, "If you eat your green beans, then you will get dessert," is false unless you eat your green beans and then can show that you did not get dessert. If you do not eat your green beans, then the statement, "If you eat your green beans, then you will get dessert," is true by default, because we have no possible way to prove it wrong.

To sum up everything we have just said using symbols we could write:
T→T=T
T→F=F
F→T=T
F→F=T

Other words which can be used to mean "If...then":

The conditional can also be pretty tricky because, unlike most of the other logical connectives, the conditional can be written in a lot of other strange ways than simply using the words, "if...then."

For example:

1) If p, q. can be rewritten as If p, then q.
"If you take me, I will go," is actually a conditional statement even though it does not contain the word then. This is because the statement, "If you take me, I will go," can be rewritten as, "If you take me, then I will go," without changing it's meaning.

2) p only if q. can be rewritten as If p, then q.
"He will win only if he practices," is also just another conditional statement in disguise, because it can be rewritten as, "If he wins, then he practiced." Be careful here! Notice that the statement, "He will win only if he practices," does NOT mean, "If he practices, then he will win." He may practice and not win! The statement says, "He will win ONLY if he practices," which means that winning REQUIRES practice. So if it is true that he wins, it must be true that he has practiced.

3) p if q. can be rewritten as If q, then p.
"It will break if you drop it," is also a conditional statement that can be rewritten as, "If you drop it, then it will break," without changing the meaning of the statement.

4) All p have the property q. can be rewritten as If something is a p, then it has the property q.
"All cows eat grass," is a conditional statement that really doesn't look like one at first. But with some careful thought, we can write it as a conditional statment in the following way without changing the meaning, "If it is a cow, then it eats grass.

5) No p have the property q. can be rewritten as If something is a p, then it does not have the property q.
"No cats can fly," is another conditional statement that doesn't look like one at first. It can be rewritten, "If it is a cat, then it can not fly," without changing the meaning.

These are just some examples of the ways that a conditional statement can be written differently; you may encounter different variations in your textbook. So don't try to follow these formulas without thinking about what sentences mean; use the technique we describe next to try to rewrite sentences in "If...then" form.

How to determine what order to put statements in when writing them in "If...then" form:

You may notice from these examples that the most difficult part of rewriting statements as "If...then" statements is trying to figure out which statement comes before the conditional arrow and which statement comes after the conditional arrow.

BE CAREFUL! It is common for people to mix up pq with qp. These two statements do not mean the same thing! For example, "If you get an A on the test, then you will pass the class" is not the same as "If you pass the class, then you got an A on the test." It may be that you only got an 88 on the test, but did well on all your other work and therefore still passed the class. The first conditional statement says that getting an A on the test is enough to ensure that you will pass the class, but it does not say that that is the only way to pass the class. The second conditional statement says that the only way you could have passed the test was to get an A on the test; in other words getting an A on the test was necessary in order for you to pass the class.

So - how do you figure out which statement to put in front of the arrow and which one to put after the arrow? To answer this question, we need to think about the different purposes each of these statements serves. To simplify things, we will give the statements before and after the conditional arrow a name: The statement which comes before the conditional arrow is called the antecedent, and the the statement which comes after the conditional arrow is called the consequent.

By the definition of the conditional, in order for the truth of a conditional statement to be preserved, whenever the antecedent is true, the consequent is also true. So the truth of the antecedent statement is sufficient or enough to make the consequent true. However, notice that it is not necessary for the antecedent statement to be true in order for the consequent to be true; the consequent could be true whether or not the antecedent is true (because by the definition of the conditional, . So the truth of the antecedent (the statement which comes first) is a necessary condition for the truth of the consequent.

Similarly, in order for the truth of a conditional statement to be preserved, if the antecedent is true, then the consequent must also be true. So the truth of the consequent is a necessary condition for the truth of the antecedent. However, the truth of the consequent statement is not itself sufficient or enough to ensure that the antecedent statement is true; if the consequent statement is true, the antecedent statement may be true or may be false, because the truth of the whole conditional statement holds as long as both statements are true or whenever the first statement is false. So the truth of the consequent (the statement which comes second) is sufficient to ensure the truth of the antecedent.

So if we have a statement that we know can be rewritten in "If...then" form, to figure out which statement is the antecedent (comes first), we need only ask, which of these statements is necessary in order for the other to be true? And to figure out which statement is the consequent (comes last), we need only ask, which of these statements is sufficient or enough to guarantee that the other statement is true?

Let's practice this with some examples:

1) All the math homework is hard.
We simply ask ourselves here - Is it necessary for something to be math homework in order for it to be hard, or is it only sufficient for something to be math homework in order to ensure that it is hard? Clearly it is only sufficient for something to be math homework in order for it to be hard - if it were necessary for something to be math homework in order for it to be hard, then this would mean that only math homework is hard, and nothing else is, which is not what this statement is saying. So we can conclude that "It is math homework" is sufficient in order for "It is hard" to be true, and therefore that "It is math homework" is the antecedent. So we can rewrite this statement as "If it is math homework, then it is hard."

2) I only go skiing when it snows.
Again we ask ourselves - Is it necessary for it to snow in order for me to go skiing, or is it only sufficient for it to snow in order to ensure that I go skiing? Clearly it is necessary for it to snow in order for me to go skiing because I will only go when it snows. So we can conclude that "It snows " is necessary in order for "I go skiing " to be true, and therefore that "It snows" is the consequent. So we can rewrite this statement as "If I go skiing, then it is snowing."

The Logical Connective "if and only if":

If and only if is symbolized by the symbol . The formal name for the logical connective if and only if is the biconditional. When the biconditional joins the statements p and q, it means that for pq to be true, whenever p is true, q must also be true; whenever q is true, p must also be true. The biconditional is actually just a conditional which goes both ways. Technically pq = (pq) and (qp). So pq is true when p is true and q is true or when p is false and q is false.

Let's look at an example in words:

Let's look at the statement, "The party will be cancelled if and only if it rains ."

This is a compound statement because it is made up of 2 simple statements joined by the logical connective if and only if . First we will break this down into two simple statements:

The first statement is, "The party will be cancelled ." We will call this statement p.

The second simple statement is, "It rains." We will call this statement q.

So now we can rewrite this statement "The party will be cancelled if and only if it rains," as pq.

When will the statement, "The party will be cancelled if and only if it rains," be true?

I will be telling the truth if p=T and q=T or if p=Fand q=F .

In other words, I will be telling the truth if it is true that the party will be cancelled and it is true that it will rain, or I will be telling the truth if it is false that the party will be cancelled and it is false that it rains. I will be lying if the party will be cancelled and it does not rain, or if the party will not be cancelled and it rains.

To sum up everything we have just said using symbols we could write:
T↔T=T
T↔F=F
F↔T=F
F↔F=T

Rewriting Statements in English Using Variables and Symbols

Our goal here is to be able to take all statments written in plain English and rewrite them using logical symbols.Once we can do this, we can move on to analyzing the structure of an arguement without getting confused by the details.

Let's try a few examples that require us to do this.

For the following examples, let p="John can write html code", q="John can write Java code", r="John gets the job", s="John is a beginning programmer".

1) "John can write html and Java code," can be written as pq.

2) "John can write html but he is a beginning programmer," can be written ps

3) "John can write html or Java code," can be written as pq.

4) "John gets the job if he can write Java code," can be written as qr.

5) "John is a beginning programmer and John cannot write Java code," can be written s∧~q.

6) "John cannot write html code and cannot write Java code only if he is a beginning programmer," can be written (~p∧~q)→s.

These were all pretty simple examples. Now lets try some more complicated ones. For example:

Example: Since all cows eat grass, cows can only live in areas where grass grows. And grass only grows in areas with a temperate climate, so there are no cows in areas with climates that are not temperate.

To do this we will need to begin by breaking this sentence down into simpler parts:

  1. Since all cows eat grass, cows can only live in areas where grass grows.
  2. And grass only grows in areas with a temperate climate,
  3. so there are no cows in areas with climates that are not temperate.

First, we want to rewrite this using only the logical connective words that we know: "and", "or", "not", "if...then", "if and only if".

  1. If all cows eat grass, then cows can only live in areas where grass grows.
  2. Because the original statement "Since all cows eat grass, cows can only live in areas where grass grows" does not contain any words which could be rewritten to mean "and" or "or", we can see that this statement must be a hidden "if...then" (or "if and only if") statement . So, in order to rewrite it in "if...then" form, we simply ask ourselves here - Is it necessary for all cows to eat grass in order for them to live in an area where grass grows, or is it only sufficient for all cows to eat grass in order for cows to live in areas where grass grows? Clearly it is only sufficient for all cows to eat grass in order for them to live in areas where grass grows, because of the way in which the word "since" is used here - it means that the statement "cows can only live in areas where grass grows" must immediately follow from the statement "all cows eat grass". So we can conclude that "all cows eat grass" is sufficient in order for "cows can only live in areas where grass grows" to be true, and therefore that "cows can only live in areas where grass growsw" is the antecedent. So we can rewrite this statement as "If it is a cow, then it eats grass."
  3. If it is a cow, then it eats grass, and

    Because the original statement "All cows eat grass" does not contain any words which could be rewritten to mean "and" or "or", we can see that this statement must be a hidden "if...then" (or "if and only if") statement . So, in order to rewrite it in "if...then" form, we simply ask ourselves here - Is it necessary for it to be a cow in order for it to eat grass, or is it only sufficient for it to be a cow in order for it to eat grass? Clearly it is only sufficient for it to be a cow in order for it to eat grass - if it were necessary for it to be a cow in order for it to eat grass, then this would mean that cows eat grass, and no other animals do, which is not what this statement is saying. So we can conclude that "it is a cow" is sufficient in order for "it eats grass" to be true, and therefore that "it is a cow" is the antecedent. So we can rewrite this statement as "If it is a cow, then it eats grass."

  4. if the grass grows in an area, then then the climate in that area is temperate,
  5. Because the original statement "grass only grows in areas with a temperate climate" does not contain any words which could be rewritten to mean "and" or "or", we can see that this statement must be a hidden "if...then" (or "if and only if") statement . So, in order to rewrite it in "if...then" form, we again ask ourselves - Is it necessary for grass to grow in order for the climate to be temperate, or is it only sufficient for grass to grow in order for the climate to be temperate? Clearly it is necessary for the climate to be temperate in order for grass to grow because grass will only grow when the climate is temperate. So we can conclude that "the climate is temperate" is necessary in order for "the grass grows in that area" to be true, and therefore that "the climate is temperate" is the consequent. So we can rewrite this statement as "If the grass grows in an area, then then the climate is temperate."

  6. Therefore, if a cow lives in an area, then the climate in that area is temperate.

    Because the original statement "there are no cows in areas with climates that are not temperate" does not contain any words which could be rewritten to mean "and" or "or", we can see that this statement must be a hidden "if...then" (or "if and only if") statement . So, in order to rewrite it in "if...then" form, we again ask ourselves - Is it necessary for an animal to be a cow in order for us to conclude that the area in which it lives is temperate, or is it only sufficient for it to be a cow in order for us to conclude that the area in which it lives is temperate? Clearly it is sufficient to know that a cow lives in an area in order to conclude that the climate is temperate because no cows will live where the climate is not temperate. So we can conclude that "the climate is temperate" is necessary in order for "a cow lives in that area" to be true, and therefore that "the climate is temperate" is the consequent. So we can rewrite this statement as "If a cow lives in an area, then then the climate is temperate."

So to sum up, we have the following compound statements, which we can now break down into simple statements:

  1. If it is a cow, then it eats grass, and
  2. if the grass grows in an area, then then the climate in that area is temperate,
  3. Therefore, if a cow lives in an area, then the climate in that area is temperate.

The simple logical statements that make up each of the parts of these compound statements are then:

p="a cow is there"

q="

 

 

 

Example: All cows eat grass, and cows can only live in areas where grass grows, so there are no cows living in areas where no grass grows.

To do this we will need to begin by breaking this sentence down into simpler parts:

  1. All cows eat grass, and,
  2. cows only live in areas where grass grows,
  3. so there are no cows living in areas where no grass grows.

First, we want to rewrite this using only the logical connective words that we know: "and", "or", "not", "if...then", "if and only if".

  1. If it is a cow, then it eats grass, and

    Because the original statement "All cows eat grass" does not contain any words which could be rewritten to mean "and" or "or", we can see that this statement must be a hidden "if...then" (or "if and only if") statement . So, in order to rewrite it in "if...then" form, we simply ask ourselves here - Is it necessary for it to be a cow in order for it to eat grass, or is it only sufficient for it to be a cow in order for it to eat grass? Clearly it is only sufficient for it to be a cow in order for it to eat grass - if it were necessary for it to be a cow in order for it to eat grass, then this would mean that cows eat grass, and no other animals do, which is not what this statement is saying. So we can conclude that "it is a cow" is sufficient in order for "it eats grass" to be true, and therefore that "it is a cow" is the antecedent. So we can rewrite this statement as "If it is a cow, then it eats grass."

  2. if grass grows in an area, then cows live in that area,
  3. Because the original statement "cows only live in areas where grass grows" does not contain any words which could be rewritten to mean "and" or "or", we can see that this statement must be a hidden "if...then" (or "if and only if") statement . So, in order to rewrite it in "if...then" form, we again ask ourselves - Is it necessary for cows to live in an area in order for us to know that grass grows there, or is it only sufficient for us to know that cows live in an area in order for us to know that grass grows there? The statement here is saying that it is necessary for grass to grow somewhere in order for cows to live there because it says that cows will only live in areas where grass grows. So we can conclude that "grass grows in an area" is necessary in order for "cows live in that area" to be true, and therefore that "cows live in that area" is the consequent. So we can rewrite this statement as "If grass grows in an area, then cows live in that area."

  4. Therefore, if a cow lives in an area, then grass grows in that area.

    Because the original statement "there are no cows in areas where no grass grows" does not contain any words which could be rewritten to mean "and" or "or", we can see that this statement must be a hidden "if...then" (or "if and only if") statement . So, in order to rewrite it in "if...then" form, we again ask ourselves - According to this statement is it necessary for a cow to live in an area in order for us to conclude that grass grows in that area, or is it only sufficient for us to know that cows live in that area in order for us to conclude that grass grows in that area? This statement claims that it is sufficient to know that a cow lives in an area in order to conclude that grass grows there because no cows will live in areas where no grass grows. So we can conclude that "grass grows in an area" is necessary in order for "a cow lives in that area" to be true, and therefore that "grass grows in that area" is the consequent. So we can rewrite this statement as "If a cow lives in an area, then grass grows in that area."

So to sum up, we have the following compound statements, which we can now break down into simple statements:

  1. If it is a cow, then it eats grass, and
  2. if cows live in an area, then then grass grows in that area,
  3. Therefore, if a cow lives in an area, then grass grows in that area.

The simple logical statements that make up each of the parts of these compound statements are then:

p="a cow is there"

q="

 

We should also be able to go back the other way: to write statements usings variables and symbols as statements in English. For the following examples, let p="John can write html code", q="John can write Java code", r="John gets the job", s="John is a beginning programmer".

1) p∧~q can be written as "John can write html code and John cannot write Java code," or if you want to be more creative, can even be written as "John can write html code, but John cannot write Java code."

2) r→(pq) can be written as "If John gets the job, then he can write html code and he can write Java code," or more simply, "If John gets the job, then he can write html and Java code." Or, if you want to be even more creative, you could write, "John gets the job only if he can write html and Java code."

When going from variables and symbols to English sentences, just make sure that your English sentences make sense. Reading them out loud to yourself can help you to check this.

Are you ready to try using logical symbols on your own now?

Now return to Brightspace to answer the Logic Lecture questions 1: Writing Statements in Logical Symbols!