# Functions and Algorithms Part E: Other Kinds of Functions (45 minutes)

## Session 3, Part E

### In This Part

• Functions and Non-Functions
• More Functions
• A Geometric Function

### Functions and Non-Functions

So far you have been thinking about functions as algorithms or machines. They take an input — in the cases you have seen, a number — and give an output. Note 6

A function is really any relationship between an input variable and an output variable in which there is exactly one output for each input. Not all functions have to work on numbers, nor do functions need to follow a computational algorithm. Below are some examples of functions and non-functions. Read through them, then answer Problems E1-E4. Note 7

The following relationships are functions.

Input: an integer
Output: classification of the input as even or odd

Input: a person’s Social Security number
Output: that person’s birth date

Input: the name of a state
Output: that state’s capital

Input: the side length of a square
Output: the area of that square

Input: a word
Output: the first letter of that word

### Problem E1

For each function described above, make a table of 5 or 6 input/output pairs. Explain why for every possible input there is only one possible output.

### Problem E2

In any of your tables, do you have repeated outputs? That is, do you have two different inputs that give the same output?

The following relationships are not functions.

Input: a number
Output: some number less than the input

Input: a whole number
Output: a factor of the input

Input: a person
Output: the name of that person’s grandparent

Input: a city name
Output: the state in which that city can be found

Input: the side length of a rectangle
Output: the area of that rectangle

Input: a word
Output: that word with the letters rearranged

### Problem E3

For each relationship described above, make a table of 5 or 6 input/output pairs. Explain why for some inputs there may be more than one possible output.

Tip: Be sure to generate pairs of inputs and outputs that show that the relationship is not a function. What property would those pairs have?

Problem E4

Come up with three more examples of relationships that are functions, and three examples of relationships that are not functions. For each relationship, explain why it is or is not a function.

Problems in Part E taken from IMPACT Mathematics Course 3, developed by Education Development Center, Inc. (New York: Glencoe/McGraw-Hill, 2000), p. 489. www.glencoe.com/sec/math

### More Functions

The next function we will explore is called the “Prime?” function. Most of you will remember that a prime number is a whole number that has only itself and one as factors. A few examples of prime numbers are 7, 13, and 29. Can you come up with some other examples? Note 8

Tip: The number 6 is not a prime number, because it has 2 and 3 as factors. The number 11 is prime, because its only factors are 1 and itself. A prime number must have exactly two factors — no more, no less.

The “Prime?” function takes positive whole numbers as inputs and produces the outputs yes and no — yes if the input is a prime, and no if the input is not a prime. Use what you know about functions and prime numbers to answer Problems E5-E11.

Problem E5

1. If the input is 3, what is the output?
2. If the input is 2, what is the output?
3. If the input is 100, what is the output?
4. If the input is 1, what is the output?

Tip: Remember, the output is either yes or no.

Problem E6

If the output of the “Prime?” function is yes, what could the input have been?

Tip: How many answers are there?

Problem E7

Explain why “Prime?” is a function.

Problem E8

If possible, describe a function that would undo the “Prime?” function. That is, if you put an input into the “Prime?” function and then put the output into your new function, you get back your original input. Note 9

Tip: Note the relationship between Problems E6 and E8.

Problem E9

The “3” function takes real numbers as inputs and always outputs the number 3.

1. If the input is 17, what is the output?
2. If the input is -2, what is the output?
3. If the input is 1.5, what is the output?

Tip: The answers to all the parts of Problem E9 are all the same number.

Problem E10

If the output is 3, what could the input have been?

Problem E11

Explain why “3” is a function.

Problem E12

If possible, describe a function that would undo the “3” function. That is, if you put an input into the “3” function and then put the output into your new function, you get back your original input.

Tip: Note the relationship between Problems E10 and E12.

### A Geometric Function

Sometimes, functions can be based on an algorithm but still not use numbers as inputs. Here’s an algorithm; let’s call it Algorithm M: Note 10

• Find the midpoint of each side of the polygon
• Connect each midpoint to the two midpoints on either side of it

Here’s what the algorithm does to a pentagon: Problem E13

Try Algorithm M on three different triangles. Describe in words how the output is related to the input.

Tip: Be sure to select triangles that are different in a significant way: acute, obtuse, scalene, isosceles.

Problem E14

How does any new triangle created by Algorithm M relate to the original, in size and in shape?

Problem E15

Try Algorithm M on several different quadrilaterals. Describe anything you notice about the outputs.

Tip: As with Problem E13, select quadrilaterals that are different in a significant way. You might also concentrate on a specific type of special quadrilateral to determine if Algorithm M does something similar to all quadrilaterals of that type.

Problem E16

Does Algorithm M describe a function? Explain how you know.

### Notes

Note 6

The final part of this session introduces a more general notation of function, rather than just algorithmic functions with numeric inputs and outputs.

Groups: Work in pairs to describe what you think a function is. Some people may recall struggling with learning or teaching about functions using diagrams like these: Note 7

Read the definition of a function and take a look at the examples in the course text.

Groups: Work on Problems E1-E4 in small groups, then as a whole group. Discuss the other examples of functions and non-functions before moving on.

Note 8

Read about the “Prime?” function and review the definition of a prime. Think about some examples of primes and non-primes and how you could test to see if a number is prime if you aren’t sure.

Work on Problems E5-E8. These problems address common confusion about both prime numbers and functions.

Groups: Summarize these problems in a discussion as everyone completes their work.

Here are some points to consider:

• 2 is a prime number. It is the only even prime.
• 1 is not a prime. This is a convention. The number 1 fits the definition of prime we have given, since it is only divisible by itself — one — and one. However, an important theorem in mathematics, called the fundamental theorem of arithmetic, says that every integer greater than one is either prime or can be expressed as a unique product of prime numbers. If 1 is considered a prime, this would no longer be the case. Consider: 10 = 2 x 5. But 10 = 1 x 2 x 5. But 10 = 1 x1 x 1 x 1 x 1 x 2 x 5. The fundamental theorem of arithmetic is essential for proving many mathematical results, so it would never do to allow 1 to be a prime!
• Two inputs to a function may give the same output. In this case, many numbers produce the output “yes,” and many will produce the output “no.”
• Not every function can be undone. In this case, if the output is “yes,” for example, there’s no way of knowing what the input was. (You may want to discuss how this is related to the point above.)

Note 9

Read about the “3” function and work through Problems E9-E12. These problems may reinforce many of the points in Note 8.

Note 10

Look at how Algorithm M works by going through the steps with a pentagon. After finishing the drawing, consider if there was any other way you could have followed the directions. For example, you could connect the midpoints in a different order. No matter how you connect the midpoints, however, the output will be the same. Once this is clear, work on Problems E13-E16.

Groups: If there is time, compare results of this geometric algorithm.

There are several surprising things that some people may notice:

• No matter what shape triangle you start with, you end up with four identical triangles inside your original triangle. Three are oriented the same way as the original triangle, and one is upside down.
• The four triangles are all similar to the original. For example, if you connect the midpoints of a right triangle, you will end up with right triangles inside.
• The areas of each of the triangles are 1/4 the area of the original (since there are 4 of them, and they are identical).
• The inside figure of the quadrilateral is a parallelogram. That is, opposite sides are parallel. It doesn’t necessarily resemble the outer figure at all.
• The inside figure of a quadrilateral contains half the original area (this may be more difficult to see).

### Solutions

Problem E1

In each case there are clear reasons that there can only be one answer. For example, a state can have only one capital city. A word can only have one first letter.

 Integer Odd or Even 1 odd 2 even 3 odd 4 even 5 odd 10 even 15 odd

 SSN DOB 590-14-6017 6/2/75 024-33-3467 10/27/70 024-33-3568 10/27/70 024-33-7146 8/10/74 036-89-0831 6/8/84

 State Capital Massachusetts Boston Texas Austin Washington Olympia North Dakota Bismarck West Virginia Charleston

 Side Length Area 1 1 2 4 3 9 4 16 5 25 10 100 15 225

 Word First Letter Word W Hey H Wow W Math M Is I Very V Cool C

Problem E2

Sure, but not always. The odd-or-even, date of birth, and letter functions have the possibility of matching outputs.

Problem E3

More tables!
For certain (not necessarily all!) inputs, there can be more than one correct output. Note how different this is from Algorithms A and B.

 Number Smaller Number 10 7 10 8 15 10 17 12 21 12 21 -5 0 -100

 Number Factor 15 3 20 5 24 3 24 4 30 10 45 9 100 20

 Person Grandparent Abbey Mary Abbey John Megan Mary Megan Alice Brian Henry

 City Name State Name New York New York Chicago Illinois Salem Massachusetts Salem Oregon Portland Oregon Portland Maine

 Side Length Area 5 20 10 20 20 20 1 1/4 5 15 10 50 100 250000

 Word Anagram ear are ear era mare ream toilets T. S. Eliot relation oriental listen silent Elvis lives

Problem E4

Other functions: a circle’s circumference is a function of its radius; the average temperature is a function of the time of year; a TV program’s rating is a function of the number of people watching the show. For each function, there can only be one output for a given input, while a non-function may have more than one output for the same input. For example, people of more than one age can wear size 11 shoes.

Problem E5

a. The output is yes, 3 is a prime number.

b. The output is yes, 2 is a prime number.

c. No, 100 is not a prime (it has lots of factors).

d. No, 1 is not a prime (it needs to have exactly two factors).

Problem E6

It could be any prime number: 2, 3, 5, 7, 11, 13, 17, 19, …

Problem E7

It’s a function because there is exactly one output. The answer is always “yes” or “no,” never both.

Problem E8

It’s a function because there is exactly one output. The answer is always “yes” or “no,” never both.

Problem E9

a. The output is 3.

b. The output is 3.

c. The output is still 3.

Problem E10

It could be any number at all. Since the output is always 3, telling us that the output is 3 doesn’t give any new information. This is the same situation as Problem D5.

Problem E11

There is exactly one value for the output. It’s always 3, but that doesn’t keep it from being a function.

Problem E12

No such function exists.

Problem E13

The output is a triangle whose sides are 1/2 the sides of the original and parallel to the original sides.

Problem E14

All the sides are half as long, and the new triangle’s area is one-fourth of the original.

Problem E15

All the formed quadrilaterals are parallelograms.

Problem E16

Yes, because there is exactly one output polygon for any starting polygon.