Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
ams301hw10

# ams301hw10

Ratings: (0)|Views: 488|Likes:

Published by: Chao Xu on Apr 29, 2010

### Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See more
See less

05/14/2010

pdf

text

original

AMS 301 Spring 2010 HW #10
Chao Xu(106978083)
7.1.6
(a) If the last digit is 1, then we have the 2nd to last digit is 0. if the last digit is 0, we have the 2nd to lastdigit is anything. Thus the recurrence relation
a
n
=
a
n
1
+
a
n
2
, where
a
0
= 1
,a
1
= 2(b) If the last digit is 1, then we have the 2nd to last digit is 0 or 2. if the last digit is not 1, we have the2nd to last digit is anything. Thus the recurrence relation
a
n
= 2
a
n
1
+ 2
a
n
2
, where
a
0
= 1
,a
1
= 3.
7.1.18
If the string of length
n
start in
or
B
, the string after it have to be a string of length
n
1 with the sameproperty. If the string of length
n
A
AB
, the string after it has to be a stringof length
n
2 with the property. Therefore we have the relation
a
n
= 2
a
n
1
+
a
n
2
.
a
0
= 1,
a
1
= 3.
7.1.20
(
G,g,r
is green, gold, red respectively)(a).
n
feet is made of arrangment of
n
1 feet ﬂags end with
r
,
g
, or
n
2 feet ﬂags end with
G
.
a
n
=2
a
n
1
+
a
n
2
,
a
0
= 1,
a
1
= 1(b).
a
n
is the amount of string meet that condition. if the string start with
G
, then we need
a
n
2
strings toﬁll the rest. if the string start with
rG
or
gG
,we need
a
n
3
strings to ﬁll the rest. if the string start with
rrG,rgG,grG
or
ggG
, we need
a
n
4
strings to ﬁll the rest. Thus we have
a
n
=
a
n
2
+ 2
a
n
3
+ 4
a
n
4
,where
a
0
= 1
,a
1
= 2
,a
2
= 5
,a
3
= 4(c). Let
a
n
be the string of length
n
with the condition. The possible starting strings are
r
or
g
with
a
n
1
strings ﬁll the rest.The possible starting strings are
G
with
a
n
2
strings ﬁll the rest.Remove strings start with
Grg
with
a
n
4
strings ﬁll the rest.
a
n
= 2
a
n
1
+
a
n
2
a
n
4
where
a
0
= 1
,a
1
= 2
,a
2
= 5
,a
3
= 12
Problem A
(a).
a
n
= 5
a
n
1
+
a
n
1
= 6
a
n
1
,
a
1
= 3.(b).
a
n
= 6
a
n
1
2
n
2
,
a
1
= 3
7.2.8
(a) Divde the numbers into 2 parts, and run ﬁnd the largest and 2nd largest on both recursively. It returns4 numbers, and 3 number of comparison is enough to ﬁnd the largest and 2nd largest of these 4 numbers.(b)
a
n
= 2
a
n/
2
+ 2(c)
a
n
=
32
n
2, as for
a
2
only one comparison is required.1

## Activity (1)

You've already reviewed this. Edit your review.