06.09.2021 Views

Discrete Mathematics- An Open Introduction - 3rd Edition, 2016a

Discrete Mathematics- An Open Introduction - 3rd Edition, 2016a

Discrete Mathematics- An Open Introduction - 3rd Edition, 2016a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

0.4. Functions 43<br />

We will also be interested in functions with domain N. Here two-line<br />

notation is no good, but describing the function algebraically is often<br />

possible. Even tables are a little awkward, since they do not describe the<br />

function completely. For example, consider the function f : N → N given<br />

by the table below.<br />

x 0 1 2 3 4 5 . . .<br />

f (x) 0 1 4 9 16 25 . . .<br />

Have I given you enough entries for you to be able to determine f (6)?<br />

You might guess that f (6) 36, but there is no way for you to know this for<br />

sure. Maybe I am being a jerk and intended f (6) 42. In fact, for every<br />

natural number n, there is a function that agrees with the table above, but<br />

for which f (6) n.<br />

Okay, suppose I really did mean for f (6) 36, and in fact, for the rule<br />

that you think is governing the function to actually be the rule. Then<br />

I should say what that rule is. f (n) n 2 . Now there is no confusion<br />

possible.<br />

Giving an explicit formula that calculates the image of any element in<br />

the domain is a great way to describe a function. We will say that these<br />

explicit rules are closed formulas for the function.<br />

There is another very useful way to describe functions whose domain<br />

is N, that rely specifically on the structure of the natural numbers. We can<br />

define a function recursively!<br />

Example 0.4.4<br />

Consider the function f : N → N given by f (0) 0 and f (n + 1) <br />

f (n) + 2n + 1. Find f (6).<br />

Solution. The rule says that f (6) f (5) + 11 (we are using 6 n + 1<br />

so n 5). We don’t know what f (5) is though. Well, we know that<br />

f (5) f (4) + 9. So we need to compute f (4), which will require<br />

knowing f (3), which will require f (2),. . . will it ever end?<br />

Yes! In fact, this process will always end because we have N as<br />

our domain, so there is a least element. <strong>An</strong>d we gave the value of<br />

f (0) explicitly, so we are good. In fact, we might decide to work up<br />

to f (6) instead of working down from f (6):<br />

f (1) f (0) + 1 0 + 1 1<br />

f (2) f (1) + 3 1 + 3 4<br />

f (3) f (2) + 5 4 + 5 9<br />

f (4) f (3) + 7 9 + 7 16<br />

f (5) f (4) + 9 16 + 9 25

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!