Logo Data Structures and Algorithms with Object-Oriented Design Patterns in C++
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_inline59063. We wish to show that tex2html_wrap_inline59085. According to Definition gif, in order to show this we need to find an integer tex2html_wrap_inline59043 and a constant c>0 such that for all integers tex2html_wrap_inline59075, tex2html_wrap_inline59093.

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

eqnarray1331

Since (n+8)>0 for all values of tex2html_wrap_inline59063, we conclude that tex2html_wrap_inline59101. I.e., tex2html_wrap_inline59103.

So, we have that for c=1 and tex2html_wrap_inline59103, tex2html_wrap_inline59093 for all integers tex2html_wrap_inline59075. Hence, tex2html_wrap_inline59085. Figure gif clearly shows that the function tex2html_wrap_inline59115 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_inline59043 that will do. For example, c=2 and tex2html_wrap_inline59127 will do, as will c=4 and tex2html_wrap_inline59131. (See Figure gif).

   figure1337
Figure: Showing that tex2html_wrap_inline59163.


next up previous contents index

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