Game Development Reference
In-Depth Information
Reviewing Domain and Range
Chapter 4 provided a discussion of how domain and range values can be
understood in the context of relations. When you can establish a relation between
a set you designate as a domain and another set you designate as a range, then you
can usually create a function that defines the relation. A function constitutes a
formalized relation between the values in the domain and the values in the range.
As Figure 6.1 illustrates, you can depict this formalization using set notation. The
expression
f ðxÞ
reads, ''the function of
x
'' or, more briefly, ''
f
of
x.
'' It formally
designates an equation that relates the domain and range. When you use such a
function, you employ the values of the domain to generate the values of the range.
As discussed in Chapter 4, you identify an equation as a function. Here is an
example of how to accomplish this:
f ðxÞ¼
3
x þ
2
You identify
f
(
x
) with the value the expression 3
x ¼
2 generates. You might just
as well write the function as
y ¼
3
x þ
2. Expressed as a function, (
f
(
x
)) generates
the value of
y
. It remains, however, that
y
is a variable that stands for the result of
the application of
f
(
x
).
When you define a function, you can designate or describe its permissible
domain and range values. For example, a function can serve as a way to relate an
element from the set of real numbers to another element in the set of real
numbers. With
f
(
x
)
¼
3
x þ
2, you can arrive at the following generalizations:
Domain
¼f
All real numbers
g
Range
¼f
All real numbers
g
Along narrower but equally formal lines, for an equation such as
y ¼
p
, you
can qualify the value of
y
so that it must be 0 or greater:
Domain
¼f
All real numbers
g
Range
¼f
y
j
y
0
g
Figure 6.1
Set notation allows you to formalize how you express relations.