Logo Data Structures and Algorithms with Object-Oriented Design Patterns in Java
next up previous contents index

A Simple Example

 

Consider the function f(n)=8n+128 shown in Figure gif. Clearly, f(n) is non-negative for all integers tex2html_wrap_inline58076. We wish to show that tex2html_wrap_inline58108. According to Definition gif, in order to show this we need to find an integer tex2html_wrap_inline58064 and a constant c>0 such that for all integers tex2html_wrap_inline58098, tex2html_wrap_inline58116.

It does not matter what the particular constants are--as long as they exist! For example, suppose we choose c=1. Then

eqnarray1402

Since (n+8)>0 for all values of tex2html_wrap_inline58076, we conclude that tex2html_wrap_inline58124. That is, tex2html_wrap_inline58126.

So, we have that for c=1 and tex2html_wrap_inline58126, tex2html_wrap_inline58116 for all integers tex2html_wrap_inline58098. Hence, tex2html_wrap_inline58108. Figure gif clearly shows that the function tex2html_wrap_inline58138 is greater than the function f(n)=8n+128 to the right of n=16.

Of course, there are many other values of c and tex2html_wrap_inline58064 that will do. For example, c=2 and tex2html_wrap_inline58150 will do, as will c=4 and tex2html_wrap_inline58154. (See Figure gif).

   figure1408
Figure: Showing that tex2html_wrap_inline58186.


next up previous contents index

Bruno Copyright © 1998 by Bruno R. Preiss, P.Eng. All rights reserved.