We are defining a random variable as a real valued
function on the sample space.
So this is a good occasion to make sure that we understand
what a function is.
To define a function, we start with two sets.
One set--
call it A--
is the domain of the function.
And we have our second set.
Then a function is a rule that for any element of A
associates an element of B. And we use a notation of this
kind to indicate that we are dealing with a function f that
maps elements of A into elements of B.
Now, two elements of A may be mapped to the same element of
B. This is allowed.
What is important, however, is that every element of A is
mapped to exactly one element of B, not more.
But it is also possible that we have some elements of B
that do not correspond to any of the elements of A.
Now, I said that a function is a rule that assigns points of
A to points in B. But what exactly do we mean by a rule?
If we want to be more precise, a function would
be defined as follows.
It would be defined as a set of pairs of values.
It would be a set of pairs of the form x, y such that x is
always an element of A, y is always an element of B, and
also-- most important--
each x in A appears in exactly one pair.
So this would be a formal definition of
what a function is.
It is collection of ordered pairs of this kind.
As a concrete example, let us start with the set consisting
of these elements here.
And let B be the set of real numbers.
And consider the function that corresponds to what we usually
call the square.
So it's a function that squares its argument.
Then this function would be represented by the following
collection of pairs.
So this is the value of x.
And this is the corresponding value of y.
Any particular x shows up just once in this
collection of pairs.
But a certain y--
for example, y equal to 1--
shows up twice, because minus 1 and plus 1 both map to the
same element of B.
Now, this is a representation in terms of ordered pairs.
But we could also think of the function as being
described by a table.
We could, for instance, put this information here in a
form of a table of this kind and say that this table
describes the function.
For any element x, it tells us what the
corresponding element y is.
However, when the set A is an infinite set it is not clear
what we might mean by saying a table, an infinite table,
whereas this definition in terms of
ordered pairs still applies.
For example, if you're interested in the function
which is, again, the square function from the real
numbers, the way you would specify that function
abstractly would be as follows.
You could write, it's the set of all pairs of this form such
that x is a real number.
And now such pairs, of course, belong to the two dimensional
plane because it's a pair of numbers.
So this set here can be viewed as a formal definition or a
specification of the squaring function.
Now, what this set is is something that we
can actually plot.
If we go in the two dimensional plane, the points
of this form are exactly the points that belong to the
graph of the square function.
So this abstract definition, really all that it says is
that a function is the same thing as the
plot of that function.
But it's important here to make a distinction.
The function is the entire plot--
so this set here is the function f--
whereas if I tell you a specific number x, the
corresponding value here would be f of x.
So here x is a number and f of x is also a number.
And those two values, x and f of x, define this particular
point on this plot.
But the function itself is the entire plot.
Let us also take this occasion to talk a little bit about the
notation and the proper way of talking about functions.
Here is the most common way that one
would describe a function.
And this is an appropriate way.
We've described the domain.
We've described the set on which the
function takes values.
And I'm telling you for any x in that set what the value of
the function is.
On the other hand, sometimes people use a more loose
language, such as for example, they would say,
the function x squared.
What does that mean?
Well, what this means is exactly this statement.
Now let us consider this function.
The function f--
again, from the reals to the reals--
that's defined by f of z equal to z squared.
Is this a different function or is it the same function?
It's actually the same function, because these two
involve the same sets.
And they produce their outputs, the values of f,
using exactly the same rule.
They take an argument and they square that argument.
Now, if you were to use informal notation, you would
be referring to that second function as
the function z squared.
And now, if you use informal language, it's less clear that
the function x squared and the function z squared are one and
the same thing, whereas with this terminology here, it
would be pretty clear that we're talking
about the same function.
Finally, suppose that we have already defined a function.
How should we refer to it in general?
Should we call it the function f, or should we say the
function f of x?
Well, when x is a number, f of x is also a number.
So f of x is not really a function.
The appropriate language is this one.
We talk about the function f, although quite often, people
will abuse language and they will use this terminology.
But it's important to keep in mind what we really mean.
The idea is that we need to think of a function as some
kind of box or even a computer program, if you wish, that
takes inputs and produces outputs.
And there's a distinction between f, which is the box,
from the value f of x that the function takes if we feed it
with a specific argument.