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 InClass 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:
Don’t 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
There’s a little problem here: since
log
x
is not realvalued for
x
≤
0
, the function
f
(
x
)
::=
1
/x
constructed in this
way is only defined for
x >
0
. To get an
F18
equal to
1
/x
defined for all
x
= 0
�
, use
(
x/

x

)
·
f
(

x

)
, where

x

=
√
x
2
.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
2
Solutions
to
InClass
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
d f
(
−
1)
(
x
)
/dx
∈
F18
. Letting
y
=
f
(
x
)
,
so
x
=
f
(
−
1)
(
y
)
, we know from Leibniz’s 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
))
.
Stated as in (
1
), this rule is easy to remember, but can easily be misleading because of the variable
switching between
x
and
y
. It’s more clearly stated using variablefree notation:
(
f
(
−
1)
)
�
=
(1
/f
�
)
f
(
−
1)
.
(2)
◦
Now, since
f
�
∈
F18
(by assumption), so is
1
/f
�
(by part (
a
)) and
f
(
−
1)
(by constructor rule
2
.), and
therefore so is their composition (by rule
3
). Hence the righthand side of equation (
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '11
 Prof.AlbertR.Meyer
 Computer Science, Logic, Derivative, Mathematical Induction, Recursion, Structural induction, textRecM atch

Click to edit the document details