# Connexions

You are here: Home » Content » Discrete Structures Problem Solving

### 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?

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

#### 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.
• VOCW

This module is included inLens: Vietnam OpenCourseWare's Lens
By: Vietnam OpenCourseWare

Click the "VOCW" link to see all content affiliated with them.

### Recently Viewed

This feature requires Javascript to be enabled.

# Discrete Structures Problem Solving

Module by: Duy Bui. E-mail the author

## Problem Solving

### Introduction

Everyone must have felt at least once in his or her life how wonderful it would be if we could solve a problem at hand preferably without much difficulty or even with some difficulties. Unfortunately the problem solving is an art at this point and there are no universal approaches one can take to solving problems. Basically one must explore possible avenues to a solution one by one until one comes across a right path to a solution. Thus generally speaking, there is guessing and hence an element of luck involved in problem solving. However, in general, as one gains experience in solving problems, one develops one's own techniques and strategies, though they are often intangible. Thus the guessing is not an arbitrary guessing but an educated one. In this chapter we are going to learn a framework for problem solving and get a glimpse of strategies that are often used by experts. They are based on the work of Polya. For further study, his book, and others such as Larson are recommended (but not required).

### A Framework for Problem Solving

The following four phases can be identified in the process of solving problems: (1) Understanding the problem

(2) Making a plan of solution

(3) Carrying out the plan

(4) Looking back i.e. verifying

Each of the first two phases is going to be explained below a little more in detail. Phases (3) and (4) should be self-explanatory.

### Understanding the Problem

Needless to say that if you do not understand the problem you can never solve it. It is also often true that if you really understand the problem, you can see a solution. Below are some of the things that can help us understand a problem. (1) Extract the principal parts of the problem.

The principal parts are:

For "find" type problems, such as "find the principal and return for a given investment", UNKNOWNS, DATA and CONDITIONS, and for "proof" type problems HYPOTHESIS and CONCLUSION. For examples that illustrate these, see examples below. Be careful about hidden assumptions, data and conditions.

(2) Consult definitions for unfamiliar (often even familiar) terminologies.

(3) Construct one or two simple example to illustrate what the problem says.

### Devising a Solution Plan

Where to start?

Start with the consideration of the principal parts: unknowns, data, and conditions for "find" problems, and hypothesis, and conclusion for "prove" problems.

What can I do?

Once you identify the principal parts and understand them, the next thing you can do is to consider the problem from various angles and seek contacts with previously acquired knowledge. The first thing you should do is to try to find facts that are related to the problem at hand. Relevant facts usually involve words that are the same as or similar to those in the given problem. It is also a good idea to try to recall previously solved similar problems.

What should I look for?

Look for a helpful idea that shows you the way to the end. Even an incomplete idea should be considered. Go along with it to a new situation, and repeat this process.

There is no single method that works for all problems. However, there is a wealth of heuristics we can try. Following are some of the often used heuristics. Add your own heuristics as you gain experience.

(1) Have I seen it before?

That is, do I know similar or related problems? Similar/related problems are ones with the same or a similar unknown or unknown may be different but the settings are the same or similar.

(2) Do a little analysis on relationships among data, conditions and unknowns, or between hypothesis and conclusion.

(3) What facts do I know related to the problem on hand?

These are facts on the subjects appearing in the problem. They often involve the same or similar words. It is very important that we know inference rules.

(4) Definitions: Make sure that you know the meaning of technical terms. This is obviously crucial to problem solving at any level. But especially at this level, if you know their meaning and understand the concepts, you can see a solution to most of the problems without much difficulty.

(5) Compose a wish list of intermediate goals and try to reach them.

(6) Have you used all the conditions/hypotheses? When you are looking for paths to a solution or trying to verify your solution, it is often a good idea to check whether or not you have used all the data/hypotheses. If you haven't, something is often amiss.

In this method we first assume that the assertion to be proven is not true and try to draw a contradiction i.e. something that is always false. If we produce a contradiction, then our assumption is wrong and therefore the assertion we are trying to prove is true.When you are stuck trying to justify some assertion, proof by contradiction is always a good thing to try.

(9) Transform/Restate the problem, then try (1) - (3) above.

(10) Working backward: In this approach, we start from what is required, such as conclusion or final (desired) form of an equation etc., and assume what is sought has been found. Then we ask from what antecedent the desired result could be derived. If the antecedent is found, then we ask from what antecedent that antecedent could be obtained. ... We repeat this process until either the data/hypotheses are reached or some easy to solve problem is reached.

(11) Simplify the problem if possible. Take advantage of symmetries which often exist.

Keep in mind that your first try may not work. But don't get discouraged. If one approach doesn't work, try another. You have to keep trying different approaches, different ideas. As you gain experience, your problem solving skills improve and you tend to find the right approach sooner.

Let us now look at some examples to illustrate the topics discussed above.

### Examples

Example 1

This is an example in which you can find a solution once you analyze and understand the unknowns and data.

Problem: A survey of TV viewers shows the following results:

To the question "Do you watch comedies?", 352 answered "Yes".,

To the question "Do you watch sports ?", 277 answered "Yes", and

To the question "Do you watch both comedies and sports ?", 129 answered "Yes".

Given these data, find, among people who watch at least one of comedies and sports, percentages of people who watch at least one of comedies and sports watch only comedies, only sports, and both comedies and sports.

Let us try to solve this problem following the framework presented above.

Understanding the Problem: This is a "find" type problem. So we try to identify unknowns, data and conditions.

The unknowns are the percentage of people who watch only comedies, the percentage of people who watch only sports, and the percentage of people who watch both comedies and sports.

The data are the three numbers: 352, 277 and 129, representing the number of people who watch comedies, sports, and both comedies and sports, respectively. Note that 352 includes people who watch both comedies and sports as well as people who watch only comedies. Similarly for 277.

The conditions are not explicitly given in the problem statement. But one can see that the percentages must add up to 100, and they must be nonnegative.

Devising a Solution Plan: Here we first examine the principal parts in detail.

First let us consider the unknowns in more detail. To calculate the percentage of the people who watch only comedies, for example, we need the number of people who watch at least one of comedies and sports, and the number of people who watch only comedies. Thus actually two unknowns are involved in each of the required percentages, and the real unknowns are the number of people in each of the categories, and the number of people who watch at least one of comedies and sports.

Next let us look at the data. First the number 352 is the number of people who watch comedies. But that is not necessarily that of the people who watch only comedies. It includes that and the number of people who watch both comedies and sports. Similarly for the second number 277.

Let us use symbols to represent each of the unknowns: Let C represent the number of people who watch only comedies, S that of the people who watch only sports, and T that of the people who watch at least one of those programs.

Then we have the following relationships among the unknowns:

C + 129 = 352

S + 129 = 277

C + S + 129 = T

From these equations we can easily obtain C = 223, S = 148, and T = 500. Thus the required percentages are 44.6%, 29.6%, and 25.8%, respectively.

All we had to do to solve this problem is to analyze relationships between the data and the unknowns, that is, nothing much beyond "understanding the problem".

Example 2

This is a problem which you can solve using similar known results.

Problem: Find the (length of) diagonal of a rectangular parallelepiped given its length, width and height.

Again let us try to solve this problem following the framework presented above.

Understanding the Problem: This is a "find" type problem. So we try to identify unknowns, data and conditions.

The unknown is the diagonal of a rectangular parallelepiped, and the data are its length, width and height. Again there are no explicitly stated conditions. But the unknown and data must all be a positive number.

Before proceeding to the next phase, let us make sure that we understand the terminologies. First a rectangular parallelepiped is a box with rectangular faces like a cube except that the faces are not necessarily a square but a rectangle as shown in Figure 1.

Next a diagonal of a rectangular parallelepiped is the line that connects its two vertices (corner points) that are not on the same plane. It is shown in Figure 2. Devising a Solution Plan: Here we first try to find relevant facts. Relevant facts often involve the same or similar words or concepts. Since the unknown is a diagonal, we look for facts concerning diagonal. Note that drawing figures here is quite helpful. One of the facts that immediately comes to our mind in this problem is Pythagoras' theorem. It has to do with right triangles and is shown in Figure 3.

Let us try to see whether or not this theorem helps. To use this theorem, we need a right triangle involving a diagonal of a parallelepiped. As we can see in Figure 4, there is a right triangle with a diagonal x as its hypotenuse.

However, the triangle here involves two unknowns: x and y. Since x is what we are looking for, we need to find the value of y. To find y, we note another right triangle shown in Figure 5.

Applying Pythagoras' theorem again, we can obtain the value of   y.

Thus   y2 = a2 + b2

is obtained from the second triangle, and

x2 = c2 + y2

is derived from the first triangle.

From these two equations, we can find that x is equal to the positive square root of   a2 + b2 + c2.

Example 3

This is a proof type problem and "proof by contradiction" is used.

Problem: Given that a, b, and c are odd integers, prove that equation ax2 + bx + c = 0 can not have a rational root.

Understanding the Problem: This is a "prove" type problem.

The hypothesis is that a, b, and c are odd integers, and the conclusion is that equation ax2 + bx + c = 0 can not have a rational root.

The hypothesis is straightforward. In the conclusion, "rational root" means a root, that is, the value of x that satisfies the equation, and that can be expressed as m/n, where m and n are integers. So the conclusion means that there is no number of the form m/n that satisfies the equation under the hypothesis.

Devising a Solution Plan: For this problem, let us try "proof by contradiction". When you are asked to prove the impossibility of an event or non-existence of certain things, this approach often is quite helpful.

Following the "proof by contradiction", let us assume that the conclusion is false, that is the equation ax2 + bx + c = 0 has a rational root m/n, where m and n are integers, when a, b, and c are odd integers. We can assume without loss of generality that m and n do not have any factors in common. Then

a(m/n)2 + b(m/n) + c = 0 . ------------------------ (1)

Let us try to derive a contradiction from this. First let us make this equation simpler, that is, let us get rid of fractions.

Since n is not equal to 0, multiplying the both sides of (1) by n2, we get

am2 + bmn + cn2 = 0. ------------------------ (2)

Since m is an integer, it is either even or odd. We are going to consider those cases one by one. That is "divide into cases".

Let us first consider the case when m is even. Then n is odd, since otherwise m and n have a common factor 2. Now am2 + bmn is even, and cn2 is odd. Hence am2 + bmn + cn2 can not be 0.

Next let us consider the case when m is odd. By an argument similar to the previous case, we can see that n is also odd. If m and n are odd, then am2, bmn, and cn2 are all odd, since a, b, and c are odd integers. However, the sum of three odd numbers can not be equal to 0.

Thus by assuming that the conclusion is false, we have arrived at a contradiction, that is m/n does not satisfy the equation. Hence our assumption must be wrong, and therefore the conclusion is correct.

Example 4

This is another proof type problem and "working backward" technique is used.

Problem: Prove that ( a + b + c )2 ≤ 4(ab + bc + ca) , if a, b, c are three sides of a triangle. Understanding the Problem: This is a "prove" type problem.

The hypothesis is that a, b, and c are three sides of a triangle, and the conclusion is that inequality ( a + b + c )2 ≤4( ab + bc + ca ) holds.

Devising a Solution Plan: Here we try "Working Backward" heuristic. That is manipulate the conclusion possibly using the hypothesis and reduce it into something that is obviously true.

First by multiplying out the left hand side of the inequality, ( a + b + c )2 = a2 + b2 + c2 + 2(ab + bc + ca).

Hence if a2 + b2 + c2 ≤ 2(ab + bc + ca) , then the conclusion holds.

Next, to see what we can try, note that we have not used the hypothesis yet, and see if it can help here.

It is well known that the sum of two sides of a triangle is greater than the third side. Hence a + b > c , b + c > a , and c + a > b hold.

From these we can obtain c(a + b) > c2 , a(b + c) > a2 , and b(c + a) > b2.

By adding these three inequalities, we get

a2 + b2 + c2 < a(b + c) + b(c + a) + c(a + b) = 2(ab + bc + ca).

Hence a2 + b2 + c2 < 2(ab + bc + ca).

Hence a2 + b2 + c2 ≤ 2(ab + bc + ca).

Hence ( a + b + c )2 ≤4(ab + bc + ca) holds.

Example 5

This is a find type problem and "working backward" technique is used.

Problem: Given a 4 quart pail and a 9 quart pail, obtain 6 quarts of water in the 9 quart pail using these two pails. You can fill or empty the pails and you can have as much water as you want.

Understanding the Problem: This is a "find" type problem.

The problem is to obtain 6 quarts of water in the 9 quart pail using 4 quart and 9 quart pails as measures. You can fill either pail from the water source or from the other pail, and you can empty the pails any time.

Devising a Solution Plan: You can solve this in a number of different ways. Here we try "Working Backward" heuristic. It starts with the desired solution and work backward step by step. At each step we try to find a state that immediately precedes the current state such that we can reach the current state from that state with one simple operation such as filling a pail or emptying a pail in this problem. We repeat this process until we reach some easily reachable state such as empty pails, full pails, one pail full and the other empty, etc.

Our solution to the original problem is obtained by traversing this process backward to the desired state.

Let us denote the 9 quart pail by A and the 4 quart pail by B for simplicity. In this problem, the desired state is to have 6 qts in A (Figure 6).

Thus in the first step of "working backward", we ask how we could get to the desired state with one operation.

As one can easily see if we could dump 3 qts from 9 qts in A, then we would have 6 qts in A. To be able to dump 3 qts from A we need 1 qt in B. Thus the state immediately preceding the current state is the one where A is full and B has 1 qt in it (Figure 7).

In the second step, the question we ask is how to get 1 qt in B. It does not look easy to get 1 qt in B. So let us see whether or not we can get 1 qt in A. If we have 1 qt in A, then we can certainly get 1 qt in B without any trouble. thus we might say that the third state is to have 1 qt in A (Figure 8).

In the third step, the question we ask is how to get 1 qt in A. This is relatively easy to accomplish because all you have to do is to get rid of 8 qts from a full A, which can be done by emptying A twice into B.

Since this state can be easily reached (all you have to do to get to this state is to fill A with water), we stop here. Our solution to the original problem is now obtained by going this process backward.

Thus first we fill up A. Then dump A into B leaving 5 qts in A (Figure 9). Then dump A into B again. This gives us 1 qt in A. Pour that into B. Then fill A and empty it into B. We now have 6 qts in A, which is what is required.

Example 6

Problem: A survey of TV viewers shows the following results:

To the question "Do you watch comedies?", 374 replied "Yes".

To the question "Do you watch sports?", 360 replied "Yes".

To the question "Do you watch detective stories?", 350 replied "Yes".

To the question "Do you watch comedies and sports?", 134 replied "Yes".

To the question "Do you watch comedies and detectives?", 96 replied "Yes".

To the question "Do you watch detectives and sports?", 241 replied "Yes".

To the question "Do you watch all three?", 37 replied "Yes".

Find the percentages of people who watch only comedies, only sports, only detective stories, comedies and sports, comedies and detectives, sports and detectives, and all three. By doing the same kind of analyses on the unknowns and data, one can find these percentages. The total number of people who watch at least one of these programs is

374 + 360 + 350 - 134 - 96 - 241 + 37 = 650,

because each of 134, 96 and 241 is counted twice into 374 + 360 + 350, and 37 is counted in three times and subtracted out three times in 374 + 360 + 350 - 134 - 96 - 241.

Similarly the number of those watching only comedies is

374 - 134 - 96 + 37 = 181,

the number of those watching only detectives is

350 - 241 - 96 + 37 = 50,

the number of those watching only sports is

360 - 134 - 241 + 37 = 22,

the number of those watching only comedies and detectives is

96 - 37 = 59,

the number of those watching only comedies and sports is

350 - 37 = 313,

the number of those watching only detectives and sports is

241 - 37 = 204.

The calculation of the percentages is omitted.

Example 7

300 people were surveyed on TV programs they watch and all 300 responded. 75 of them say they watch a regular sports program, 210 say they watch a regular comedy program, and 36 say they watch both. There is a special detective story program which conflicts with the regular sports and comedy programs. If those who watch regular programs do not want to miss them, how many people can watch the special?

To answer the question, all you have to do is to find the total number of people who watch at least one of the regular sports and comedy programs. Then 300 minus that number is the answer. Thus this problem is essentially the same as Example 1, and the answer is 300 - (75 + 210 - 36) = 51.

Example 8

300 people were surveyed. 50 of them watch sports, 140 watch comedies, and 134 do not watch either of them. Then how many of them watch both comedies and sports? The relationships among various groups of people in this problem are the same as those of Example 1 or 7. Only the data are slightly different.

Since 300 were surveyed and 134 do not watch either sports or comedies, 166 watch at least one. Hence 50 + 140 - 166 = 24 watch both. Thus 50 - 24 = 26 watch only sports, and 140 - 24 = 116 watch only comedies.

#### Reference

Polya: G. Polya, How to Solve It, A New Aspect of Mathematical Method, Second Ed., Princeton University Press, Princeton, NJ, 1985. Larson: L. C. Larson, Problem-Solving Through Problems, Springer-Verlag, New York, NY, 1983.

## Content actions

PDF | EPUB (?)

### What is an EPUB file?

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

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?

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