ch4.2 Sequences MrG 2010.1116

4020 days ago by calcpage123

#1) a(n)=a(n-1)+a(n-2) #1) a(0)=1 #1) a(1)=1 #1) 1,1,2,3,5,8,13,21,.... 
       
#2) def f(n): return 1/(n*(n+1)) f(4) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{1}{20}
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{1}{20}
#3)a(0)=c, a(1)=c+d, a(2)=c+2d, a(3)=c+3d, ... #3)a(0)=c, a(3)=c+3d, a(6)=c+6d, a(9)=c+9d, ... 
       
#4)a(1)=3=c+d, a(7)=21=c+7d, a(12)=c+12d=36 var('c,d') solve((3==c+d,21==c+7*d),(c,d)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left[\left[c = 0, d = 3\right]\right]
\newcommand{\Bold}[1]{\mathbf{#1}}\left[\left[c = 0, d = 3\right]\right]
plot((-x+3,-x/7+3),-10,10,aspect_ratio=1) 
       
#5) def seq(n): return 4*3**n seq(0) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}4
\newcommand{\Bold}[1]{\mathbf{#1}}4
for i in range(10): print seq(i) 
       
4
12
36
108
324
972
2916
8748
26244
78732
4
12
36
108
324
972
2916
8748
26244
78732
#6)a(0)=1=a*r**0, a=1 #6)a(10)=1024=1*r**10, r=2 #6)a(n)=1*2**n def geo(a,r,n): return a*r**n geo(1,2,20) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}1048576
\newcommand{\Bold}[1]{\mathbf{#1}}1048576
for i in range(21): print(geo(1,2,i)) 
       
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
65536
131072
262144
524288
1048576
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
65536
131072
262144
524288
1048576
#7) var('c,d,n') term1=c+(n-1)*d term2=c+(n+1)*d sum=expand(term1+term2) avg=sum/2 show(term1) show(term2) show(sum) show(avg) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}{\left(n - 1\right)} d + c
\newcommand{\Bold}[1]{\mathbf{#1}}{\left(n + 1\right)} d + c
\newcommand{\Bold}[1]{\mathbf{#1}}2 \, d n + 2 \, c
\newcommand{\Bold}[1]{\mathbf{#1}}d n + c
\newcommand{\Bold}[1]{\mathbf{#1}}{\left(n - 1\right)} d + c
\newcommand{\Bold}[1]{\mathbf{#1}}{\left(n + 1\right)} d + c
\newcommand{\Bold}[1]{\mathbf{#1}}2 \, d n + 2 \, c
\newcommand{\Bold}[1]{\mathbf{#1}}d n + c
#8) var('a,r,n') assume(a>0) term1=a*r**(n-1) term2=a*r**(n+1) prod=simplify(term1*term2) avg=(sqrt(prod)).simplify_radical() show(term1) show(term2) show(prod) show(avg) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}a r^{{\left(n - 1\right)}}
\newcommand{\Bold}[1]{\mathbf{#1}}a r^{{\left(n + 1\right)}}
\newcommand{\Bold}[1]{\mathbf{#1}}a^{2} r^{{\left(2 \, n\right)}}
\newcommand{\Bold}[1]{\mathbf{#1}}r^{n} a
\newcommand{\Bold}[1]{\mathbf{#1}}a r^{{\left(n - 1\right)}}
\newcommand{\Bold}[1]{\mathbf{#1}}a r^{{\left(n + 1\right)}}
\newcommand{\Bold}[1]{\mathbf{#1}}a^{2} r^{{\left(2 \, n\right)}}
\newcommand{\Bold}[1]{\mathbf{#1}}r^{n} a
#9) def silly(n): return 11 for i in range(10): print silly(i) 
       
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
#10) def weird(n): return n/(n+1) for i in range(10): print weird(i).n() 
       
0.000000000000000
0.500000000000000
0.666666666666667
0.750000000000000
0.800000000000000
0.833333333333333
0.857142857142857
0.875000000000000
0.888888888888889
0.900000000000000
0.000000000000000
0.500000000000000
0.666666666666667
0.750000000000000
0.800000000000000
0.833333333333333
0.857142857142857
0.875000000000000
0.888888888888889
0.900000000000000
#11) def weird2(n): return (n-2)/(n-5) for i in [6..600000]: if i%60000==0: print i,weird2(i).n() 
       
60000 1.00005000416701
120000 1.00002500104171
180000 1.00001666712964
240000 1.00001250026042
300000 1.00001000016667
360000 1.00000833344908
420000 1.00000714294218
480000 1.00000625006510
540000 1.00000555560700
600000 1.00000500004167
60000 1.00005000416701
120000 1.00002500104171
180000 1.00001666712964
240000 1.00001250026042
300000 1.00001000016667
360000 1.00000833344908
420000 1.00000714294218
480000 1.00000625006510
540000 1.00000555560700
600000 1.00000500004167
#12) def weird2(n): return n/sqrt(n**2-1) for i in [10..100]: if i%10==0: print i,weird2(i).n() 
       
10 1.00503781525921
20 1.00125234864352
30 1.00055601894761
40 1.00031264656071
50 1.00020006002001
60 1.00013891783077
70 1.00010205643748
80 1.00007813415647
90 1.00006173411124
100 1.00005000375031
10 1.00503781525921
20 1.00125234864352
30 1.00055601894761
40 1.00031264656071
50 1.00020006002001
60 1.00013891783077
70 1.00010205643748
80 1.00007813415647
90 1.00006173411124
100 1.00005000375031