# Homework Help: Discrete Mathematics (confused and help wanted)

1. Sep 11, 2008

### sampahmel

Dear all,

I have an example taken from the book titled "Discrete Mathematics For Computer Science" by Kenneth Bogart. In the book, page 11, example 1.2-2, it says: Write down all the functions from the two element set {1,2} to the two element set {a,b}.

I couldn't understand the reasoning behind its explanation and I can't tell the difference between the functions in algebra and calculus.

According to the book, it says there are 8 functions for the example above. Why? And how is it different from a typical function? ( Functions in algebra and calculus has an infinite number sets of numbers as their domain) I do know about that and functions in discrete mathematics has a finite sets as their domain and range, I also understand this too and so ....How did the book came to the conclusion that there are 8 functions?

Thank you,

S

2. Sep 11, 2008

### CRGreathouse

A function is defined by the value of the function at each point in its domain. So the number of functions is just the number of choices for f(1) times the number of choices for f(2). I would say that there are only four functions:

f(1) = a, f(2) = a
f(1) = b, f(2) = b
f(1) = a, f(2) = b
f(1) = b, f(2) = a

I don't distinguish between functions in algebra, calculus, and discrete math; they're all just functions. True, some functions have the real numbers as their domain while others have the positive reals, the integers, the nonnegative integers, some other infinite set, or a finite set, but they all follow the same rules.

3. Sep 12, 2008