[Combinatorics/Computer Mathematics] Homework Chapter 3 Recursion Relations

Table of contents

1

Draw on the plane n n n infinite straight lines, each of which intersects at different points. The number of infinite regions they constitute is recorded as f ( n ) f(n) f(n),求 f ( n ) f(n) f(n)Complete feedthrough system .
f ( 1 ) = 2 , f ( 2 ) = 4 , f ( 3 ) = 6 f(1)=2,f(2)=4,f(3)=6 < /span>f(1)=2,f(2)=4,f(3)=6
{ f ( n ) = f ( n − 1 ) + 2 f ( 1 ) = 2 \begin{cases} f(n)=f(n-1)+2\\f(1)=2 \end{cases} { f(n)=f(n1)+2f(1)=2
Special expedition process: x 1 − 1 = 0 x_1-1=0 x11=0,即 x 1 = 1 x_1=1 x1=1,1是 P ( x ) = 0 P(x)=0 P(x)=Single root of 0.
Special solution: a n 1 n = a n an1^n=an an1n=an. Substitution system: a n = a ( n − 1 ) + 2 an=a(n-1)+2 an=a(n1)+2 a = 2 a=2 a=2
通解为: c 1 + c 2 × 1 n c_1+c_2\times 1^n c1+c2×1n,ie f ( n ) = c 1 + c 2 + 2 n f(n)=c_1+c_2+2n f(n)=c1+c2+2n,以 f ( 1 ) = 2 f(1)=2 f(1)=2, because c 1 = c 2 = 0 c_1=c_2=0 c1=c2=0.
Transfer system: f ( n ) = 2 n f(n)=2n f(n)=2n

2

n nIn the n ternary number, the number of sequences in which 1 does not appear to the right of any 2 is recorded as f ( n ) f( n) f(n),求 f ( n ) f(n) f(n)'s recommendation system< /span>

f ( n − 1 ) f(n-1) f(n1) n − 1 n-1 nA sequence that satisfies the condition in 1 digit ternary number. When introducing a new number at the leftmost position: based on n − 1 n-1 nFor a qualified sequence of 1 bits, additional 0s and 1s can be introduced without affecting subsequent sequences. There is 2 f ( n − 1 ) 2f(n-1) 2f(n1) situations. If 2 is forcibly introduced on the left, then only 0 and 2 can be selected later, there are 2 n − 1 2^{n-1} 2n1different circumstances. Note: f ( n ) = 2 f ( n − 1 ) + 2 n − 1 f(n)=2f(n-1)+2^{n-1} f(n)=2f(n1)+2n1

初值: f ( 1 ) = 3 , f ( 2 ) = 8 f(1)=3,f(2)=8 f(1)=3,f(2)=8

Use high school students’ method to homogenize the recurrence expression:
f ( n ) = 2 f ( n − 1 ) + 2 n − 1 2 f ( n ) = 4 f ( n − 1 ) + 2 n 2 f ( n − 1 ) = 4 f ( n − 2 ) + 2 n − 1 f(n)=2f(n-1)+2^{n-1}\\ 2f(n)=4f(n-1)+2^n\\ 2f(n-1)=4f(n-2)+2^{n-1} f(n)=2f(n1)+2n12f(n)=4f(n1)+2n2f(n1)=4f(n2)+2n1
Type 1-Type 3 arrangement:
f ( n ) − 4 f ( n − 1 ) + 4 f ( n − 2 ) = 0 f(n)-4f(n-1)+4f(n-2)=0 f(n)4f(n1)+4f(n2)=0
Special expedition route:
x 2 − 4 x + 4 = 0 x^2-4x+4=0 x24x+4=0
Obtained double root: x 1 = x 2 = 2 x_1=x_2=2 x1=x2=2
f ( n ) = ( b 1 + b 2 n ) 2 n f(n)=(b_1+b_2n)2 ^n f(n)=(b1+b2n)2n
f ( 1 ) = 3 , f ( 2 ) = 8 f(1)=3,f(2)=8 f(1)=3,f(2)=8Assignment, solution b 1 = 1 , b 2 = 0.5 b_1=1,b_2=0.5 b1=1,b2=0.5

即: f ( n ) = ( 1 + n / 2 ) 2 n f(n)=(1+n/2)2^n f(n)=(1+n/2)2n

3

n nIn the n digit quaternary number, the number of sequences in which 2 and 3 appear an even number of times is recorded as f ( n ) f(n) f(n),求 f ( n ) f(n) The recurrence relation satisfied by f(n) .
Let the number that satisfies the condition be f ( n ) f(n) f(n)
则对满足条件的 f ( n − 1 ) f(n-1) f(n1), No. 1 new intake 0 or 1, Yes 2 f ( n − 1 ) 2f(n-1) 2f(n1)species.
g ( n ) g(n) g(n) means there is an even number of 2 An odd number of 3's. Because of symmetry, g ( n ) g(n) g(n) can also mean that there are odd numbers An even number of 2s and a sequence of 3s.
Note h ( n ) h(n) h(n)even number 2 sequence quantity.
Present n − 1 n-1 nIn the 1 quaternary number, there is an even number of sequences of 2 plus a non-2 number, totaling 3 h ( n − 1 ) 3h(n-1) 3h(n1)Sequence.
Present n − 1 n-1 nIn 1 quaternary number, there is an odd number of 2 sequences with a 2 added, and there are 4 n − 1 − h ( n − 1 ) 4^{n-1}-h(n-1) 4n1h(n1)Sequence.
h ( n ) = 3 h ( n − 1 ) + 4 n − 1 − h ( n − 1 ) = 4 n − 1 + 2 h ( n − 1 ) h(n) =3h(n-1)+4^{n-1}-h(n-1)=4^{n-1}+2h(n-1) h(n)=3h(n1)+4n1h(n1)=4n1+2h(n1) h ( 1 ) = 3 h(1)=3 h(1)=3
The number of sequences with an even number of 2 minus the number of sequences with an even number of 2 and odd number of 3 is:
f ( n ) = h ( n ) − g ( n ) f(n)=h(n)-g(n) f(n)=h(n)g(n)
Even number length ( n − 1 ) (n-1) (n1) 0/1, yes 2 f ( n − 1 ) 2f(n-1) 2f(n1) species. One of the numbers 2 and 3 is odd and the other is even, there is 2 g ( n − 1 ) 2g(n-1) 2g(n1)
f ( n ) = 2 f ( n − 1 ) + 2 g ( n − 1 ) f(n)=2f(n-1)+2g(n-1) f(n)=2f(n1)+2g(n1)

求解 h ( n ) = 2 h ( n − 1 ) + 4 n − 1 h(n)=2h(n-1)+4^{n-1 } h(n)=2h(n1)+4n1: Special expedition x − 2 = 0 x-2=0 x2=0 x = 2 x=2 x=2 is a double root.
This is a non-homogeneous linear equation.
The special solution is: b 0 ⋅ 4 n b_0\cdot 4^n b04n. General substitution h ( n ) = 2 h ( n − 1 ) + 4 n − 1 h(n)=2h(n-1)+4^{n-1} h(n)=2h(n1)+4n1,得 b 0 ⋅ 4 n = 2 b 0 ⋅ 4 n − 1 + 4 n − 1 b_0\cdot 4^n=2b_0\cdot 4^{n-1}+4^{n-1} b04n=2b04n1+4n1,解得 b 0 = 1 2 b_0=\frac {1}{2} b0=21
The general solution of the homogeneous recurrence relation is c 1 ⋅ 2 n c_1\cdot 2^n c12n
h ( n ) = c 1 ⋅ 2 n + 1 2 ⋅ 4 n h(n)=c_1\cdot 2^n+\frac 12\cdot 4^n h(n)=c12n+214n, first assignment h ( 1 ) = 3 h(1)=3 h(1)=3,解得 c 1 = 1 2 c_1=\frac 12 c1=21
即: h ( n ) = 1 2 ⋅ 2 n + 1 2 ⋅ 4 n h(n)=\frac 12\cdot 2^n+\frac 12\cdot 4^n h(n)=212n+214n

General h ( n ) h(n) h(n)代入
{ f ( n ) = h ( n ) − g ( n ) f ( n ) = 2 f ( n − 1 ) + 2 g ( n − 1 ) \begin{cases} f(n)=h(n)-g(n)\\ f(n)=2f(n-1)+2g(n-1) \end{cases} { f(n)=h(n)g(n)f(n)=2f(n1)+2g(n1)
Use the method of high school students:
f ( n − 1 ) = h ( n − 1 ) − g ( n − 1 ) f(n-1)=h(n- 1)-g(n-1) f(n1)=h(n1)g(n1) 2 f ( n − 1 ) = 2 h ( n − 1 ) − 2 g ( n − 1 ) 2f(n-1)=2h(n-1)-2g(n-1) 2f(n1)=2h(n1)2g(n1)
f ( n ) = 2 h ( n − 1 ) − 2 g ( n − 1 ) + 2 g ( n − 1 ) = 2 h ( n − 1 ) = 2 n − 1 + 4 n − 1 f(n)=2h(n-1)-2g(n-1)+2g(n-1)=2h(n-1)=2^{n-1}+4^{n-1} f(n)=2h(n1)2g(n1)+2g(n1)=2h(n1)=2n1+4n1

即: f ( n ) = 2 n − 1 + 4 n − 1 f(n)=2^{n-1}+4^{n-1} f(n)=2n1+4n1

4

Find the value that satisfies the difference between adjacent bits being 0 n n nNumber of binary sequences f ( n ) f(n) f(n)
Last first place 1 , any second place in the number, yes f ( n − 1 ) f(n-1) f(n1) species.
The last digit is 0, the second to last digit is only 1, and the third to last digit is arbitrary, there are f ( n − 2 ) f(n-2 ) f(n2)种。
初值: f ( 1 ) = 2 , f ( 2 ) = 3 , f ( 3 ) = 5 , f ( 4 ) = 8 f(1)=2,f(2)=3,f(3)=5,f(4)=8 f(1)=2,f(2)=3,f(3)=5,f(4)=8
{ f ( n ) = f ( n − 1 ) + f ( n − 2 ) f ( 1 ) = 2 , f ( 2 ) = 3 \begin{cases} f(n)=f(n-1)+f(n-2)\\ f(1)=2,f(2)=3 \end{cases} { f(n)=f(n1)+f(n2)f(1)=2,f(2)=3
This is a constant coefficient linear homogeneous recurrence relationship, and the characteristic equation is x 2 − x − 1 = 0 x^2-x-1=0 x2x1=0,Special expedition base x 1 = 1 + 5 2 , x 2 = 1 − 5 2 x_1=\frac{1+ \sqrt{5}}{2},x_2=\frac{1-\sqrt{5}}{2} x1=21+5 ,x2=215 , the general solution is f ( n ) = c 1 ( 1 + 5 2 ) n + c 2 ( 1 − 5 2 ) n f(n)=c_1(\frac{ 1+\sqrt{5}}{2})^n+c_2(\frac{1-\sqrt{5}}{2})^n f(n)=c1(21+5 )n+c2(215 )n
Root f ( 1 ) = 2 , f ( 2 ) = 3 f(1)=2,f(2)= 3f(1)=2,f(2)=3, 反推 f ( 0 ) = 1 f(0)=1 f(0)=1,General 0 , 1 0,1 0,1代入 f ( n ) f(n) f(n)
{ c 1 + c 2 = 1 1 + 5 2 c 1 + 1 − 5 2 c 2 = 2 \begin{cases} c_1+c_2=1\\ \frac{1+\sqrt{5}}{2}c_1+\frac{1-\sqrt{5}}{2}c_2=2 \end{cases} { c1+c2=121+5 c1+215 c2=2
解得: c 1 = 5 + 3 2 5 , c 2 = 5 − 3 2 5 c_1=\frac{\sqrt 5+3}{2\sqrt 5},c_2=\frac{\sqrt 5-3}{2\sqrt 5} c1=25 5 +3,c2=25 5 3

f ( n ) = 5 + 3 2 5 ( 1 + 5 2 ) n + 5 − 3 2 5 ( 1 − 5 2 ) n f(n)=\frac{\sqrt 5+3}{2\sqrt 5}(\frac{1+\sqrt{5}}{2})^n+\frac{\sqrt 5-3}{2\sqrt 5}(\frac{1-\sqrt{5}}{2})^n f(n)=25 5 +3(21+5 )n+25 5 3(215 )n

This sequence is similar to the Fibonacci sequence (the recursive formula is exactly the same as the Fibonacci sequence, but the initial values ​​are different) and it looks like a lot 5 \sqrt 5 5 \sqrt 5 5 , but it can actually be converted into integers.

8

The length of the three letters a, b, c is transmitted on the channel: n n A string of n, if there are two a a If a appears continuously, the channel cannot transmit. Let f ( n ) f(n) f(n)Display credit path available as well as long为 n n The number of strings in n, find f ( n ) f(n) f(n)Complete feedthrough system .

f ( 1 ) = 3 f(1)=3 f(1)=3, f ( 2 ) f(2) f(2)可为ab,ac,ba,bb,bc,ca,cb,cc, f ( 2 ) = 8 f(2)=8 f(2)=8
f ( n ) f(n) f(n)为长为 n n The number of strings in n. When the leftmost character is b b bor c c When c, the remaining characters are arbitrary. Total 2 f ( n − 1 ) 2f(n-1) 2f(n1) species. When the leftmost character is a, the second character is b or c, and the remaining characters are arbitrary. Total 2 f ( n − 2 ) 2f(n-2) 2f(n2)species. Note: f ( n ) = 2 f ( n − 1 ) + 2 f ( n − 2 ) f(n)=2f(n-1)+2f(n-2) < /span>f(n)=2f(n1)+2f(n2)
This is a homogeneous recurrence relationship with constant coefficients, and the characteristic equation is x 2 − 2 x − 2 = 0 x^2-2x-2=0 x22x2=0,Special base x 1 = 1 + 3 , x 2 = 1 − 3 x_1=1+\sqrt 3,x_2 =1-\sqrt 3 x1=1+3 ,x2=13
Root f ( 1 ) f(1) f(1) f ( 2 ) f(2) f(2)Anti-inference f ( 0 ) = 1 f(0)=1 f(0)=1
{ c 1 + c 2 = 1 ( 1 + 3 ) c 1 + ( 1 − 3 ) c 2 = 3 \begin{cases} c_1+c_2=1\\ (1+\sqrt 3)c_1+(1-\sqrt 3)c_2=3 \end{cases} { c1+c2=1(1+3 )c1+(13 )c2=3
解得 c 1 = 1 2 + 3 3 , c 2 = 1 2 − 3 3 c_1=\frac 12+\frac{\sqrt 3}{3},c_2=\frac 12-\frac{\sqrt 3}{3} c1=21+33 ,c2=2133

f ( n ) = ( 1 2 + 3 3 ) ( 1 + 3 ) n + ( 1 2 − 3 3 ) ( 1 − 3 ) n f(n)=(\frac 12+\frac{\sqrt 3}{3})(1+\sqrt 3)^n+(\frac 12-\frac{\sqrt 3}{3})(1-\sqrt 3)^n f(n)=(21+33 )(1+3 )n+(2133 )(13 )n

9(1)

See 8

9(2)

{ f ( n ) = 4 f ( n − 1 ) − 4 f ( n − 2 ) f ( 0 ) = 1 , f ( 1 ) = 3 \begin{cases} f(n)=4f(n-1)-4f(n-2)\\ f(0)=1,f(1)=3 \end{cases} { f(n)=4f(n1)4f(n2)f(0)=1,f(1)=3

Special expedition x 2 − 4 x + 4 = 0 x^2-4x+4=0 x24x+4=0,解得 x 1 = x 2 = 2 x_1=x_2=2 x1=x2=2, double root x = 2 x=2 x=2
f ( n ) = ( b 1 + b 2 n ) 2 n f(n)=(b_1+b_2n)2^n f(n)=(b1+b2n)2n
代入
{ 1 = ( b 1 ) 2 0 3 = ( b 1 + b 2 ) 2 1 \begin{cases} 1=(b_1)2^0\\ 3=(b_1+b_2)2^1 \end{cases} { 1=(b1)203=(b1+b2)21
解得 b 1 = 1 , b 2 = 1 2 b_1=1,b_2=\frac 12 b1=1,b2=21
即: f ( n ) = ( 1 + 1 2 n ) 2 n f(n)=(1+\frac 12n)2^n f(n)=(1+21n)2n

9(3)

{ f ( n ) = − f ( n − 1 ) + 3 f ( n − 2 ) + 5 f ( n − 3 ) + 2 f ( n − 4 ) f ( 0 ) = 1 , f ( 1 ) = 0 , f ( 2 ) = 1 , f ( 3 ) = 2 \begin{cases} f(n)=-f(n-1)+3f(n-2)+5f(n-3)+2f(n-4)\\ f(0)=1,f(1)=0,f(2)=1,f(3)=2 \end{cases} { f(n)=f(n1)+3f(n2)+5f(n3)+2f(n4)f(0)=1,f(1)=0,f(2)=1,f(3)=2

Special expedition course x 4 + x 3 − 3 x 2 − 5 x − 2 = 0 x^4+x^3-3x^2-5x-2=0 < /span>x4+x33x25x2=0,解得 x 1 = x 2 = x 3 = − 1 , x 4 = 2 x_1=x_2=x_3=- 1,x_4=2 x1=x2=x3=1,x4=2
inside, − 1 -1 1This is a triple root, 2 2 2This is 1 layer root.
f ( n ) = c 1 ( − 1 ) n + c 2 ( − 1 ) n n + c 3 ( − 1 ) n n 2 + c 4 2 n f(n)=c_1(- 1)^n+c_2(-1)^nn+c_3(-1)^nn^2+c_42^n f(n)=c1(1)n+c2(1)nn+c3(1)nn2+c42n
代入初值 f ( 0 ) = 1 , f ( 1 ) = 0 , f ( 2 ) = 1 , f ( 3 ) = 2 f(0)=1,f(1)=0,f(2)=1,f(3)=2 f(0)=1,f(1)=0,f(2)=1,f(3)=2
{ c 1 + c 4 = 1 − c 1 − c 2 − c 3 + 2 c 4 = 0 c 1 + 2 c 2 + 4 c 3 + 4 c 4 = 1 − c 1 − 3 c 2 − 9 c 3 + 8 c 4 = 2 \begin{cases} c_1+c_4=1\\ -c_1-c_2-c_3+2c_4=0\\ c_1+2c_2+4c_3+4c_4=1\\ -c_1-3c_2-9c_3+8c_4=2 \end{cases} c1+c4=1c1c2c3+2c4=0c1+2c2+4c3+4c4=1c13c29c3+8c4=2
解得 c 1 = 7 9 , c 2 = − 1 3 , c 3 = 0 , c 4 = 2 9 c_1=\frac 79,c_2=-\frac 13,c_3=0,c_4=\frac 29 c1=97,c2=31,c3=0,c4=92

f ( n ) = 7 9 ( − 1 ) n − 1 3 ( − 1 ) n n + 2 9 2 n f(n)=\frac 79(-1)^n-\frac 13(-1)^nn+\frac 292^n f(n)=97(1)n31(1)nn+922n

9(4)

{ f ( n ) − 4 f ( n − 1 ) + 4 f ( n − 2 ) = n ⋅ 2 n f ( 0 ) = 0 , f ( 1 ) = 1 \begin{cases} f(n)-4f(n-1)+4f(n-2)=n\cdot 2^n\\ f(0)=0,f(1)=1 \end{cases} { f(n)4f(n1)+4f(n2)=n2nf(0)=0,f(1)=1

Homogeneous characteristic equation x 2 − 4 x + 4 = 0 x^2-4x+4=0 x24x+4=0, x = 2 x=2 x=2 is the 2-fold root of the characteristic equation.

Then the non-homogeneous special solution is n 2 ( b 1 n + b 0 ) 2 n n^2(b_1n+b_0)2^n n2(b1n+b0)2n. General 1,0,-1,-2 assignment special solution:

f ( 1 ) = 2 ( b 1 + b 0 ) , f ( 0 ) = 0 , f ( − 1 ) = − b 1 + b 0 2 , f ( − 2 ) = ( − 2 b 1 + b 0 ) f(1)=2(b_1+b_0),f(0)=0,f(-1)=\frac{-b_1+b_0}{2},f(-2)=(-2b_1+b_0) f(1)=2(b1+b0),f(0)=0,f(1)=2b1+b0,f(2)=(2b1+b0)

Substitute 0 and 1 into the original equation:
{ 0 − 4 × − b 1 + b 0 2 + 4 ( − 2 b 1 + b 0 ) = 0 2 ( b 1 + b 0 ) − 0 + 4 − b 1 + b 0 2 = 2 \begin{cases} 0-4\times\frac{-b_1+b_0}{2}+4(-2b_1+b_0)=0\ \ 2(b_1+b_0)-0+4\frac{-b_1+b_0}{2}=2 \end{cases} { 04×2b1+b0+4(2b1+b0)=02(b1+b0)0+42b1+b0=2
解得 b 0 = 1 2 , b 1 = 1 6 b_0=\frac 12,b_1=\frac 16 b0=21,b1=61, then the non-homogeneous special solution is n 2 ( 1 6 n + 1 2 ) 2 n n^2(\frac 16n+\frac 12)2^n n2(61n+21)2n
The general solution of the homogeneous equation is: ( c 1 n + c 0 ) 2 n (c_1n+c_0)2^n a>(c1n+c0)2n.
Add the general solution and the specific solution: f ( n ) = ( c 1 n + c 0 ) 2 n + n 2 ( 1 6 n + 1 2 ) 2 n f(n)=(c_1n+c_0)2^n+n^2(\frac 16n+\frac 12)2^n f(n)=(c1n+c0)2n+n2(61n+21)2n

Substitute the general solution into the original equation:
{ c 0 2 0 + 0 = 0 ( c 1 + c 0 ) × 2 1 + 1 ( 1 6 + 1 2 ) × 2 = 1 \begin{cases} c_02^0+0=0\\ (c_1+c_0)\times 2^1+1(\frac 16+\frac 12)\times 2=1 \end{cases} { c020+0=0(c1+c0)×21+1(61+21)×2=1
解得 c 0 = 0 , c 1 = − 1 6 c_0=0,c_1=-\frac 16 c0=0,c1=61

f ( n ) = ( c 1 n + c 0 ) 2 n + n 2 ( 1 6 n + 1 2 ) 2 n f(n)=(c_1n+c_0)2^n+n^2(\frac 16n+\frac 12)2^n f(n)=(c1n+c0)2n+n2(61n+21)2n

9(5)

{ f ( n ) = n f ( n − 1 ) + n ! ( n ≥ 1 ) f ( 0 ) = 2 \begin{cases} f(n)=nf(n-1)+n!(n\ge 1)\\ f(0)=2 \end{cases} { f(n)=nf(n1)+n!(n1)f(0)=2

Use an iterative method (a high school student method from beginning to end).

Two connections n ! n! n!
f ( n ) n ! = f ( n − 1 ) ( n − 1 ) ! + 1 \frac{f(n)}{n!}=\frac{f(n-1)}{(n-1)!}+1 n!f(n)=(n1)!f(n1)+1
g ( n ) = f ( n ) n ! g(n)=\frac{f(n)}{n!} g(n)=n!f(n)

g ( n ) = g ( n − 1 ) + 1 g(n)=g(n-1)+1 g(n)=g(n1)+1 g ( 0 ) = 2 g(0)=2 g(0)=2,则 g ( n ) = n + 2 g(n)=n+2 g(n)=n+2,则 f ( n ) n ! = n + 2 \frac{f(n)}{n!}=n+2 n!f(n)=n+2

f ( n ) = ( n + 2 ) n ! f(n)=(n+2)n! f(n)=(n+2)n!

9(6)

{ f ( n ) = ( n + 2 ) f ( n − 1 ) ( n ≥ 1 ) f ( 0 ) = 1 \begin{cases} f(n)=(n+2)f(n-1)(n\ge 1)\\ f(0)=1 \end{cases} { f(n)=(n+2)f(n1)(n1)f(0)=1

Use the iterative method (the method used by high school students from beginning to end).
f ( n ) = ( n + 2 ) f ( n − 1 ) = ( n + 2 ) ( n + 1 ) f ( n − 2 ) = . . . = ( n + 2 ) ( n + 1 ) . . . ( n + i ) f ( n + i − 3 ) = ( n + 2 ) ( n + 1 ) . . . ( 3 ) f ( 0 ) = ( n + 2 ) ! / 2 f(n)=(n+2)f(n-1)=(n+2)(n+1)f(n-2)\\ =...\\=(n+2) (n+1)...(n+i)f(n+i-3)\\ =(n+2)(n+1)...(3)f(0)\\=(n+ 2)!/2 f(n)=(n+2)f(n1)=(n+2)(n+1)f(n2)=...=(n+2)(n+1)...(n+i)f(n+i3)=(n+2)(n+1)...(3)f(0)=(n+2)!/2

11

设有 n n n elliptic curves, any two intersect at two points, any three elliptic curves do not intersect at one point. Ask this question: n n < /span>How many parts do n ellipses divide the plane into?
Note n − 1 n-1 < /span>n1 ellipses divide the plane into f ( n − 1 ) f(n-1) f(n1) parts, then the new ellipse will pass through the original n − 1 n-1 n1Place of arrival 2 ( n − 1 ) 2(n-1) 2(n1) new planar areas.
f ( n ) = f ( n − 1 ) + 2 ( n − 1 ) f ( 1 ) = 2 , f ( 2 ) = 4 f(n)=f(n-1 )+2(n-1)\\ f(1)=2,f(2)=4 f(n)=f(n1)+2(n1)f(1)=2,f(2)=4

Solution: Use the method of high school students

f ( n ) = f ( n − 1 ) + 2 ( n − 1 ) = f ( n − 2 ) + 2 ( n − 2 ) + 2 ( n − 1 ) = f ( n − i ) + 2 ( n − i ) . . . 2 ( n − 1 ) = f ( 1 ) + 2 + 4 + . . . 2 ( n − 1 ) = 2 + 2 ( 1 + n − 1 ) ( n − 1 ) 2 = 2 + n ( n − 1 ) f(n)=f(n-1)+2(n-1)\\=f(n-2)+2(n-2)+2(n-1)\\=f(n-i)+2(n-i)...2(n-1)\\=f(1)+2+4+...2(n-1)\\=2+2\frac{(1+n-1)(n-1)}{2}\\=2+n(n-1) f(n)=f(n1)+2(n1)=f(n2)+2(n2)+2(n1)=f(ni)+2(ni)...2(n1)=f(1)+2+4+...2(n1)=2+22(1+n1)(n1)=2+n(n1)

12

request n n nThe number of positive decimal integers with an even number of 5's
f ( 1 ) = 8 , f ( 2 ) = 81 f(1)=8,f(2)=81 f(1)=8,f(2)=81,记 f ( n ) f(n) f(n) n n The number of even 5 occurrences in n decimal number.
9 × f ( n − 1 ) 9\times f(n-1) 9×f(n1) 电影 f ( n − 1 ) f(n-1) f(n1)An even number of 5 appears, but the newly introduced lowest bit is not 5.
9 × 1 0 n − 2 − f ( n − 1 ) 9\times 10^{n-2}-f(n-1) 9×10n2f(n1)Before display n − 1 n-1 nAn odd number of 5s appear in the 1 bit, and 5 is introduced in the lowest bit. 9 × 1 0 n − 2 9\times 10^{n-2} 9×10n2Display: 对于一个 n − 1 n-1n1 digit number, middle n − 2 n-2 nThe 2 bit is optional (0 to 9, a total of 10 selection methods), but the highest bit cannot be 0 (1 to 9, a total of 9 selection methods). Therefore, 9 × 1 0 n − 2 − f ( n − 1 ) 9\times 10^{n-2}-f(n-1) 9×10n2f(n1)display n − 1 n-1 nThe total number of 1 digits is subtracted from the number of even numbers of 5, leaving an odd number of 5s.

f ( n ) = 9 × f ( n − 1 ) + 9 × 1 0 n − 2 − f ( n − 1 ) = 9 × 1 0 n − 2 + 8 f ( n − 1 ) f(n)=9\times f(n-1)+9\times 10^{n-2}-f(n-1)=9\times 10^{n-2}+8f(n-1) f(n)=9×f(n1)+9×10n2f(n1)=9×10n2+8f(n1)

Using the high school method,
f ( n + 1 ) = 9 × 1 0 n − 1 + 8 f ( n ) f(n+1)=9\times 10^ {n-1}+8f(n) f(n+1)=9×10n1+8f(n)
10 f ( n ) = 9 × 1 0 n − 1 + 80 f ( n − 1 ) 10f(n)=9\times 10^{n-1}+80f(n-1) 10f(n)=9×10n1+80f(n1)

Identity: f(n) = 18f(n − 1) − 80 f(n − 2) f(n)=18f(n-1)-80f( n-2) f(n)=18f(n1)80f(n2)
Special expedition course: x 2 − 18 x + 80 = 0 x^2- 18x+80=0x218x+80=0,解得 x 1 = 10 , x 2 = 8 x_1=10,x_2=8 x1=10,x2=8
f ( n ) = c 1 × 1 0 n + c 2 × 8 n f(n)=c_1\times 10^n+c_2\times 8^n f(n)=c1×10n+c2×8n

Initial value: Because 0 is a 0-digit number, there are 8 types of 1-digit numbers, 1/2/3/4/6/7/8/9, f ( 1 ) = 8 f(1)=8 f(1)=8; in 2nd place, 1 x ‾ \overline{1x} 1x/ 2 x ‾ \overline{2x} 2x/ 3 x ‾ \overline{3x} 3x/ 4 x ‾ \overline{4x} 4x/ 6 x ‾ \overline{6x} 6x/ 7 x ‾ \overline{7x} 7x/ 8 x ‾ \overline{8x} 8x/ 9 x ‾ \overline{9x} 9x 8 × 9 = 72 8\times 9=72 8×9=72, and another 55, a total of 73 with an even number of 5s. f ( 2 ) = 73 f(2)=73 f(2)=73
{ 10 c 1 + 8 c 2 = 8 100 c 1 + 64 c 2 = 73 \begin{cases} 10c_1+8c_2=8\\ 100c_1+64c_2=73 \end{cases} { 10c1+8c2=8100c1+64c2=73
解得 c 1 = 9 20 , c 2 = 7 16 c_1=\frac {9}{20},c_2=\frac{7}{16} c1=209,c2=167

f ( n ) = 9 20 × 1 0 n + 7 16 × 8 n f(n)=\frac{9}{20}\times 10^n+\frac{7}{16}\times 8^n f(n)=209×10n+167×8n

Guess you like

Origin blog.csdn.net/qq_46640863/article/details/134995819