MIT6_042JS10_lec19_sol

MIT6_042JS10_lec19_sol - Massachusetts Institute of...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Massachusetts Institute of Technology 6.042J/18.062J, Spring 10 : Mathematics for Computer Science March 17 Prof. Albert R. Meyer revised March 15, 2010, 675 minutes Solutions to In-Class Problems Week 7, Wed. Problem 1. The Elementary 18.01 Functions ( F18 s) are the set of functions of one real variable defined recur- sively as follows: Base cases: The identity function, id( x ) ::= x is an F18 , any constant function is an F18 , the sine function is an F18 , Constructor cases: If f,g are F18 s, then so are 1. f + g , fg , e g (the constant e ), 2. the inverse function f ( 1) , 3. the composition f g . (a) Prove that the function 1 /x is an F18 . Warning: Dont confuse 1 /x = x 1 with the inverse, id ( 1) of the identity function id( x ) . The inverse id ( 1) is equal to id . Solution. log x is the inverse of e x so log x F18 . Therefore so is c log x for any constant c , and hence e c log x = x c F18 . Now let c = 1 to get x 1 = 1 /x F18 . 1 (b) Prove by Structural Induction on this definition that the Elementary 18.01 Functions are closed under taking derivatives . That is, show that if f ( x ) is an F18 , then so is f ::= df/dx . (Just work out 2 or 3 of the most interesting constructor cases; you may skip the less interesting ones.) Solution. Proof. By Structural Induction on def of f F18 . The induction hypothesis is the above statement to be shown. Creative Commons 2010, Prof. Albert R. Meyer . 1 Theres a little problem here: since log x is not real-valued for x , the function f ( x ) ::= 1 /x constructed in this way is only defined for x > . To get an F18 equal to 1 /x defined for all x = 0 , use ( x/ | x | ) f ( | x | ) , where | x | = x 2 . 2 Solutions to In-Class Problems Week 7, Wed. Base Cases: We want to show that the derivatives of all the base case functions are in F18 . This is easy: for example, d id( x ) /dx = 1 is a constant function, and so is in F18 . Similarly, d sin( x ) /dx = cos( x ) which is also in F18 since cos( x ) = sin( x + / 2) F18 by rules for constant functions, the identity function, sum, and composition with sine. This proves that the induction hypothesis holds in the Base cases. Constructor Cases: ( f ( 1) ). Assume f,df/dx F18 to prove df ( 1) ( x ) /dx F18 . Letting y = f ( x ) , so x = f ( 1) ( y ) , we know from Leibnizs rule in calculus that 1 df ( 1) ( y ) /dy = dx/dy = . (1) dy/dx For example, d sin ( 1) ( y ) /dy = 1 / ( d sin( x ) /dx ) = 1 / cos( x ) = 1 / cos(sin ( 1) ( y )) ....
View Full Document

This note was uploaded on 05/27/2011 for the course CS 6.042J taught by Professor Prof.albertr.meyer during the Spring '11 term at MIT.

Page1 / 7

MIT6_042JS10_lec19_sol - Massachusetts Institute of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online