# Function Pyramids

A function pyramid is a structure where each entry in the pyramid is determined by the two entries below it. Can you figure out how the pyramid is generated?

## Problem

*This problem extends the ideas explored in* *Number Pyramids* *and* *More Number Pyramids**.*

A function pyramid is a structure where each entry in the pyramid is determined by the two entries below it, together with some function:

*The function used in the problems **Number Pyramids** and **More Number Pyramids** could be expressed as: $$f(a,b) = a+b$$*

Here is a function pyramid for you to explore. Select numbers for the three spaces on the bottom layer, and look at how the rest of the numbers change. *If you are using a mobile phone, you may need to rotate your screen to landscape orientation.***Can you work out the function that determines the middle and top layers of the pyramid?**

**Here are some questions you might like to consider:**

Can you choose numbers for the bottom layer so that the number 1 appears in the top cell?

Can you do it in more than one way?

Can you choose numbers for the bottom layer so that the number 5 appears in the top cell?

Can you do it in more than one way?

Can you choose numbers for the bottom layer so that the numbers in the middle layer are negative?

Can you choose numbers for the bottom layer so that the number in the top cell is negative?

## Getting Started

Can you find numbers for the bottom layer that give you whole numbers on the second layer?

You might like to change just one number at a time.

What is special about the numbers on the bottom layer that give whole number answers for the second layer?

## Student Solutions

Sam Yun from Sri Kdu International School in Malaysia and Daskesh from Hymers College in the UK tried some numbers systematically. This is Sam Yun's work:

For simplicity, we will keep 1 value constant whilst changing the other value. We will start by keeping the number '1' constant. Then, we can change the other value by adding '1' to it each time.

Test 1: Input = 1, 1 Output = 0

Test 2: Input = 1, 2 Output = 1

Test 3: Input = 1, 3 Output = 1.58...

Test 4: Input = 1, 4 Output = 2

Now, repeat this with a different constant.

Test 5: Input = 2, 2 Output = 2

Test 6: Input = 2, 3 Output = 2.58...

Test 7: Input = 2, 4 Output = 3

Test 8: Input = 2, 5 Output = 3.32...

From these few tests, we can see that the outputs are either whole numbers or decimals. Because it is hard to identify patterns from decimal outputs, we can ignore those tests and only focus on the tests that outputs whole numbers.

List of inputs that outputs whole numbers:

1 & 1 1 & 2 1 & 4 2 & 2 2

& 4

Possible relationship(s):

- Powers of 2 (1 = 2^0, 2 = 2^1...)

Dakshesh also focused on the powers of 2:

Matthew from the UK noticed a different pattern in the numbers:

2 positives gave a positive outcome

1 positive and 1 negative gave no outcome

2 negatives gave a positive outcome.

This led me to think that there was either a multiplication or division going on between the 2 numbers, since the 2 negatives multiplied/divided would output a positive number.

Then, since the function was clearly undefined for those inputs $(a,b)$ where $ab<0$, then there are a few common functions which hold this property.

From this observation, Florence from Roedean School in the UK, Agathiyan from Hymers College in the UK in the UK and Matthew worked out what the function $f$ was. Deepak from Macmillan Academy in the UK explained what the function does:

Multiply the two input numbers below the number which is the output and $2^{\text{output}} = \text{input}\times\text{input}$

Agathiyan from Hymers Dakshesh, Sum Yun, Florence, Matthew and Agathiyan wrote this as:

$f(a,b) = \log_2{a} + \log_2{b}$, which is equal to $\log_2{ab}$

Dakshesh went on to express the numbers in the pyramid in terms of the numbers at the bottom, and to find out whether it is possible to get negative numbers in the middle or top layers:

## Teachers' Resources

### Why do this problem?

This problem uses the 'hook' of a mystery function to engage students' curiosity about inverse functions of exponentials. Requiring no prior knowledge of logarithms, the interactivity in this task could be used to start off a conversation about the law $\log(a) + \log(b) = log(ab)$. The function used in the task uses powers of 2 as a starting point.

### Possible approach

*"If the bottom two numbers are $2^x$ and $2^y$ then the row above is $x+y$"*

*"Multiply the two bottom numbers together. If you get a power of 2, it's the power that goes in the next row."*

These two different ways of thinking about the function could be used to introduce the law $\log(a)+\log(b)=\log(ab)$.

*One interesting discussion point for students who are already familiar with logarithms could be whether these two functions are in fact equivalent, and which one the computer is using - if $a$ and $b$ are both negative, the computer does in fact produce an answer, which indicates that it is performing the product first before taking logs!*

Once everyone is clear about how the function pyramid works, invite students to work on the following challenges:

- Can you choose numbers for the bottom layer so that the number 1 appears in the top cell? Can you do it in more than one way?
- Can you choose numbers for the bottom layer so that the number 5 appears in the top cell? Can you do it in more than one way?
- Can you choose numbers for the bottom layer so that the numbers in the middle layer are negative?
- Can you choose numbers for the bottom layer so that the number in the top cell is negative?

### Key questions

What is special about the numbers on the bottom layer that give whole number answers for the second layer?

### Possible extension

Students could create function pyramids of their own, perhaps using a spreadsheet, for other functions.

### Possible support

Suggest that students pick one number on the bottom row to change at a time. How does the value in the second layer change? When is the output a whole number?