Download Buiiding Brick Walls: Counting Techniques, Number Patterns

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Mathematics of radio engineering wikipedia , lookup

John Wallis wikipedia , lookup

Addition wikipedia , lookup

Ethnomathematics wikipedia , lookup

Moiré pattern wikipedia , lookup

Patterns in nature wikipedia , lookup

Elementary mathematics wikipedia , lookup

Transcript
If we want to build a brick wall out of the usual size of brick (which has a length twice as
long as its height) and if our wall is to be two units tall, we can make our wall in a number of
patterns, depending on how long we want it.
There’s just one wall pattern which is 1 unit wide - made by putting the brick on its end.
There are 2 patterns for a wall of length 2: two side-ways bricks laid on top of each other
and two bricks long-ways up put next to each other. For length 3 there are 3 different
patterns (see picture below – note the 2nd and 3rd patterns are considered to be different
patterns).
How many patterns can you find for a wall of length 4?
How many different patterns are there for a wall of length 5?
How many different patterns are there for a wall of length 6?
Look at the number of patterns you have found for a wall of length 1, 2, 3, 4, 5 and 6. See
if you can predict the number of patterns for a wall of length 7, or in fact for a wall of
length n.
n
1
2
3
4
5
6
7
8
Number of patterns for wall of length n
A solution to the Brick Wall Puzzle:
Two starting cases
Usually it is quite easy to verify the STARTING CASES for a puzzle because we can find all
the solutions and just count them.
For this puzzle we can show that f(1)=1 and that f(2)=2 as follows, using the picture of the
solutions above:
f(1)=1
There is just one pattern for a wall of length 1 (the single brick is placed upright), so f(1)=1.
f(2)=2
There are 2 patterns if we have a wall of length 2 as we have seen in the diagrams of the
puzzle page, so f(2)=2 “the number of patterns for walls of height 2 and length 2 is 2”.
Now for the general case: f(n)=f(n-1)+f(n-2)
What about f(n) - the number of patterns for walls of height 2 and length n?
This is the general case and we must be sure that our reasoning applies to ALL n bigger than
2 (we have covered the two cases for n=1 and n=2 above).
Consider what happens at the left end of the wall....
.... either there is a brick on its end
....or else there is a brick on its side - in which case there must be another one
on top of it as there is no other way to make the height of 2.
There are no more cases.
Let’s look at these two cases:
If we start a wall of length n with a single upright brick then we need patterns for walls of
length n-1 to complete it. How many of these are there? There are f(n-1) of them since
that’s what f(n-1) means.
The only other way a pattern of length n can be made is to start with the two-flat-brickson-top-of-each-other pattern. We can then continue with any wall pattern of height 2 and
of length n-2 and there are f(n-2) of these.
So all the ways of finding walls of length n are covered by the two cases:
an upright brick first and then any pattern of length n-1
or else the two-flat-bricks followed by any pattern of length n-2.
So the number of patterns of length n is the sum of the number of patterns of length (n-1)
and the number of patterns of length (n-2). In terms of the “f” notation in mathematics, we
have
f(n) = f(n-1) + f(n-2) generally and the two starting cases: f(1) = 1 and f(2) = 2
Reference: Dr. Ron Knott Visiting Fellow, Department of Mathematics, School of
Electronics and Physical Sciences, University of Surrey.
One way to describe the solution to this puzzle is recursively as follows:
Let f(n) be the general solution to the puzzle (number of patterns) for a wall of length n.
Verify that f(n) = f(n-1) + f(n-2) for the values you have found.
Note that our puzzle started with n=1, so we need n to be at least 3 for the above formula
to make sense. Thus we will need to find f(1) and f(2) just by looking at those particular
cases (not using the recursive formula).
There is a famous sequence of numbers that satisfies this type of recursive relationship.
They are called Fibonacci numbers. There is also an interesting relationship between
Fibonacci numbers and something you might be familiar with, called Pascal’s Triangle.
Pascal's Triangle continues on forever - it has an infinite number of rows. Each number is
the sum of the two numbers just above it. For the 1 at the beginning of each row, we could
imagine that Pascal's triangle is surrounded by zeros: to get the first 1 in any row except
row 0, add a zero from the upper left to the 1 above and to the right. To get the 3 in row 4,
add the 1 left and above to the 2 right and above.
Row
Row
Row
Row
Row
Row
Row
0
1
2
3
4
5
6
1
1
1
1
1
1
1
3
4
5
6
1
2
6
10
15
1
3
1
4
10
20
1
5
15
1
6
1
Another way to think about the numbers in Pascal’s Triangle relates to a particular counting
argument. Many disciplines and sciences require the answer to the question: How Many?
Combinatorics is the field of mathematics that deals with problems of selection and/or
arrangement of objects within a finite or discrete system, and is concerned with “counting”
the number of possible configurations of objects of a given type. And often the numbers
are just too large to count in the 1, 2, 3, 4 ordinary ways.
There are many problems in which we are interested in determining the number of ways in
which k objects can be selected from n distinct objects without regard to the order in
which they are selected. Such selections are called combinations of n things taken k at a
time. The formula for finding the number of combinations of k objects you can choose from
a set of n objects is:
For example, From 4 people, how many distinct groups of 2 people be chosen to work on
some project? The answer is 4C2=6. If the persons are called A, B, C and D then the distinct
groups are AB, AC, AD, BC, BD and CD.
The entries in Pascal’s Triangle are given by this combination formula. For example, to find
the number of combinations of two objects that can be taken from a set of three objects,
all we need to do is look at the second entry in row 3 (remember that the 1 at the top of the
triangle is always counted as row zero and that a 1 on the lefthand side of the triangle is
always counted as entry zero for that row).
Some other puzzles (with surprisingly similar solutions):
1. I try and take the stairs rather than the elevator whenever I can so that I get a little
more exercise these days. If I’m in a hurry, I can leap two stairs at once otherwise it’s the
usual one stair at a time. If I mix these two kinds of action - step onto the next or else leap
over the next onto the following one - then in how many different ways can I get up a flight
of n steps?
For example, for 3 steps, I can do step, step, step OR step, leap OR leap, step for a total of
3 ways to climb 3 steps.
How many ways are there to climb a set of 4 stairs? 5 stairs? n stairs? Why?
2. Ann and Lucas are playing with colored rods. There are lots of each of the various
lengths, each length having its own unique color, from single orange ones (length 1 which are
cubes), length 2 are magenta, length 3 are blue and so on.. Lucas has just taken out all the
length 1 rods (the orange cubes) to play with and has left Ann with all the rest. She can
always make a line of length n because there is a variety of colored rod of that length
available, provided n is not one, of course! So the puzzle is:
In how many ways can she make a line of length N if there are no rods of length 1
available?
For a line of length 3, she can use only a rod of length 3.
But for a line of length 4, she can use either a rod of length 4 or else two rods of length 2.
When it comes to making a line of length 5, she has several ways of doing it:
5=2+3=3+2
length 3 = 3
length 4 = 4 = 2 + 2
length 5 = 5 = 2 + 3 = 3 + 2
So what we are doing is listing sums where the number ONE must not appear in
the sum. The order of the numbers matters so that 2+3 is not the same sum as
3+2 in this problem.
3. British people can be very reserved sometimes and like not to bother people by sitting
next to them in public places if they can possibly help it. Consider rows of seats of
different lengths, but insist that no one can sit next to anyone else! There may be no one
in the row, or just one person, but wherever there are two people or more, they must always
be separated by at least one empty seat so that no one sits next to anyone else.
How many ways are there to seat people in a row with n seats?
4. This puzzle is about coin tossing, and in particular about how long we might have to wait
before we get two heads, one after the other.
If we toss a coin twice, then there are four possible outcomes:
TT, TH, HT and HH
In only 1 of these four do we get two heads.
What happens if we have to wait for exactly three tosses before we get two heads?
This time the possibilities are
TTT, TTH, THT, HTH, HTT, THH
Note that we do not have HHT or HHH in this list because we would have had two heads
after only 2 tosses which was covered earlier. So there is again just 1 way to get two heads
appearing at the end of three tosses, H on the second and H on the third toss.
How many ways are there if HH appears on the 3rd-and-4th tosses? TTTT, TTTH, TTHT,
TTHH, THTT, THTH, HTHH, HTHT, HTTH, HTTT.
This time we find 2 sequences.
Can you find a method of generating all the sequences of n coin-tosses that do not have HH
until the last two tosses?
Can you find a formula for how many of these will end in HH?
Reference: Dr. Ron Knott Visiting Fellow, Department of Mathematics, School of
Electronics and Physical Sciences, University of Surrey.