EXAMPLE 68
Recognizing QR Code JIS X 0510 In NoneUsing Barcode Control SDK for Software Control to generate, create, read, scan barcode image in Software applications.
Paint QR-Code In NoneUsing Barcode maker for Software Control to generate, create QR Code 2d barcode image in Software applications.
f[x_]=
Scanning QR In NoneUsing Barcode scanner for Software Control to read, scan read, scan image in Software applications.
QR Code Printer In C#.NETUsing Barcode drawer for Visual Studio .NET Control to generate, create QR Code ISO/IEC18004 image in .NET framework applications.
g[x_]= x + 2 x + 3; h1[x_]= f[x]+ g[x] 3+ x + 2 x + x2 h2[x_]= f[x] g[x] -3 + x - 2 x - x2 h3[x_]= f[x]g[x] x (3 + 2 x + x2)
Printing QR Code JIS X 0510 In Visual Studio .NETUsing Barcode creator for ASP.NET Control to generate, create QR Code 2d barcode image in ASP.NET applications.
Printing QR Code In VS .NETUsing Barcode maker for .NET framework Control to generate, create QR Code JIS X 0510 image in .NET framework applications.
Basic Concepts
Quick Response Code Encoder In VB.NETUsing Barcode maker for .NET framework Control to generate, create Denso QR Bar Code image in .NET applications.
GS1 128 Printer In NoneUsing Barcode maker for Software Control to generate, create EAN / UCC - 14 image in Software applications.
h4[x_]= f[x]/g[x] x 3 + 2 x + x2 h5[x_]= f[g[x]] 3 + 2 x + x2 h6[x_]= g[f[x]] 3+ 2 x + x
Generating EAN13 In NoneUsing Barcode drawer for Software Control to generate, create GTIN - 13 image in Software applications.
Code 128 Code Set B Generation In NoneUsing Barcode drawer for Software Control to generate, create Code-128 image in Software applications.
The composition of two or more functions can be accomplished with the Composition command. Note that Composition is a functional operation and as such, its arguments are functions, f, not f[x].
Barcode Maker In NoneUsing Barcode encoder for Software Control to generate, create bar code image in Software applications.
Printing Code 3/9 In NoneUsing Barcode creator for Software Control to generate, create USS Code 39 image in Software applications.
Composition[f1, f2, f3, ...] constructs the composition f1 o f2 o f3...
Draw Postnet 3 Of 5 In NoneUsing Barcode maker for Software Control to generate, create Postnet image in Software applications.
Bar Code Maker In NoneUsing Barcode generation for Font Control to generate, create barcode image in Font applications.
EXAMPLE 69
Creating USS-128 In NoneUsing Barcode creator for Microsoft Excel Control to generate, create UCC.EAN - 128 image in Office Excel applications.
Make Bar Code In Objective-CUsing Barcode creation for iPhone Control to generate, create bar code image in iPhone applications.
f[x_] =
EAN-13 Supplement 5 Drawer In NoneUsing Barcode creator for Word Control to generate, create GTIN - 13 image in Office Word applications.
Bar Code Reader In C#Using Barcode Control SDK for .NET framework Control to generate, create, read, scan barcode image in .NET applications.
g[x_] = x2 + 2 x + 3; h1 = Composition[f, g]; h1[x] 3 + 2 x + x2 h2 = Composition[g, f]; h2[x] 3+ 2 x + x
Scanning UPC-A Supplement 5 In VB.NETUsing Barcode decoder for .NET Control to read, scan read, scan image in VS .NET applications.
Data Matrix ECC200 Drawer In JavaUsing Barcode printer for BIRT Control to generate, create Data Matrix 2d barcode image in Eclipse BIRT applications.
If we wish to compute the composition of a function with itself we could, of course, use Composition[f, f], Composition[f, f, f], and so forth. A more convenient tool is Nest or NestList.
Nest[f, expression, n] applies f to expression successively n times. NestList[f, expression, n] applies f to expression successively n times and returns a list of all the intermediate calculations from 0 to n. (Lists are discussed in detail in 3.)
EXAMPLE 70
f[x_]= x2; Nest[f, x, 5] x32 NestList[f, x, 5] {x, x2, x4, x8, x16, x32} Nest[f, 2 x + 3, 5] (3 + 2 x)32 NestList[f, 2 x + 3, 5] {3 + 2 x, (3 + 2 x)2, (3 + 2 x)4, (3 + 2 x)8, (3 + 2 x)16, (3 + 2 x)32}
EXAMPLE 71 The function Framed[symbol] draws a frame around symbol. We can use Nest and NestList
to show the effect of repetitive framing.
Basic Concepts
Nest[Framed,x,10]
NestList[Framed,x,10]
SOLVED PROBLEMS
2.72 If f(x) = sin x + 2 cos x and g(x) = 2 sin x 3 cos x, construct ( f + g) (x), ( f g) (x), ( f g) (x), and ( f /g) (x) and evaluate them at /2.
SOLUTION
f[x_]= Sin[x]+ 2 Cos[x]; g[x_]= 2 Sin[x] 3 Cos[x]; h1[x_]= f[x]+ g[x] Cos[x]+ 3 Sin[x] h2[x_]= f[x] g[x] 5 Cos[x] Sin[x] h3[x_]= f[x] g[x] (2 Cos[x]+ Sin[x])( 3 Cos[x]+ 2 Sin[x]) h4[x_]= f[x]/g[x] 2 Cos[x] + Sin[x] 3 Cos[x] + 2 Sin[x] h1[ /2] 3 h2[ /2] 1 h3[ /2] 2 h4[ /2] 1 2
2.73 Let f ( x ) = 1 + x . Compute ( f o f o f o f o f )(x).
SOLUTION
f[x_]= 1 + x ; Nest[f, x, 5] 1+ 1+ 1+ 1+ 1+ x
Basic Concepts
2.74 Let f ( x ) = 1 . Let f n ( x ) = (14 o ...o f )( x ) . Evaluate f ( x ), f 2 ( x ), f 3 ( x ), f 4 ( x ), and f 5 ( x ) . Then evaluate fof 24 3 1+ x
f (1), f 2 (1), f 3 (1), . . . , f 20 (1). What do you observe Convert to a decimal form and approximate lim f n (1) .
SOLUTION
f[x_]=
1 1+ x
NestList[f, x, 5] 1 1 1 1 1 , , , x,1 + x , 1 1 1 1 1+ 1+ 1+ 1+ 1 1 1 1+ x 1+ 1+ 1+ 1 1+ x 1+ 1+ 1 1+ x 1+ 1 1+ x
NestList[f, 1, 20] 10 946 5 1,1,2,3,5, 8 ,13,21,55, 89 ,144,233,377,610, 987 ,1597,2584,4181, 6765 , 3 2 3 5 8 13 21 34 89 144 233 377 610 987 1597 2584 4181 6765 10 946 17 711
The numerators (and denominators) appear to be terms of the Fibonacci sequence. NestList[f, 1, 20] //N
{1.,0.5,0.666667,0.6,0.625,0.615385,0.619048,0.617647,0.618182,0.617978, 0.618056,0.618026,0.618037,0.618033,0.618034,0.618034,0.618034, 0.618034,0.618034,0.618034,0.618034}
The numbers appear to be approaching a limit of approximately 0.618034.
2.75 If x is an approximation to a , it can be shown that 1 x + a is a better approximation. (This is a
special case of Newton s method.) Use NestList to observe the first 10 approximations obtained in computing 3 , starting with x = 100.
SOLUTION
a = 3; f[x_] = 1 x + a ; 2 x NestList[f, 100, 10] // N {100., 50.015, 25.0375, 12.5787, 6.40858, 3.43835, 2.15543, 1.77363, 1.73254, 1.73205, 1.73205}