Combinations of Functions

Read this section for an introduction to combinations of functions, then work through practice problems 1-9.

A Really "Holey" Function

The graph of the greatest integer function has a break or jump at each integer value, but how many breaks can a function have? The next function illustrates just how broken or "holey" the graph of a function can be.

Define h(x) =\left\{ \begin{array}{ll}
2 & \mbox { if  x  is a rational number }\\1 & \mbox { if  x  is an irrational number} \end{array} \right.

Then h( 3 ) = 2, h( 5/3 ) = 2 and h( –2/5) = 2 since 3, 5/3 and –2/5 are all rational numbers. h( π ) = 1, h(\sqrt 7  ) = 1, and h( \sqrt 2  ) = 1 since π, \sqrt7 and \sqrt 2 are all irrational numbers. These and some other points are plotted in Fig. 16 .


In order to analyze the behavior of h(x) the following fact about rational and irrational numbers is useful.


Fact: "Every interval contains both rational and irrational numbers" or, equivalently, "If a and b are real numbers and a < b, then there is

(i) a rational number R between a and b (a < R < b), and

(ii) an irrational number I between a and b (a < I < b)".

The Fact tells us that between any two places where the y = h(x) = 1 (because x is rational) there is a place where y = h(x) is 2 because there is an irrational number between any two distinct rational numbers. Similarly, between any two places where y = h(x) = 2 (because x is irrational) there is a place where y = h(x) = 1 because there is a rational number between any two distinct irrational numbers. The graph of y = h(x) is impossible to actually draw since every two points on the graph are separated by a hole. This is also an example of a function which your computer or calculator can not graph because in general it can not determine whether an input value of x is irrational.


Example 7:
Sketch the graph of  g(x) =  \left\{ \begin{array}{ll}  2 &\mbox { if  x  is a rational number }\\ x
    & \mbox { if  x  is an irrational number } \end{array} \right.

Solution: A sketch of the graph of y = g(x) is shown in Fig. 17 .

When x is rational, the graph of y = g(x) looks like the "holey" horizontal line y = 2. When x is irrational, the graph of  y = g(x) looks like the "holey" line y = x.


Practice 9: Sketch the graph of r(x)  =  \left\{ \begin{array}{ll} 2 & \mbox  { if  x  is a rational number }\\ x & \mbox { if  x  is an irrational number } \end{array}
    \right.