Devam Ediyor

500319 Generating Sequences With Recurrence Relations

Hi

I need to write a program containing recursive functions that will generate values of a recurrence relation and compare the growth to two possible given functions.

Sample Output

Enter a numeric value for A(0): 1

Enter a numeric value for A(1): 2

n A(n)=4A[n-1]-4A[n-2] 2^n 2.1^n

0 1 1 1

1 2 2 2.1

2 4 4 4.41

3 8 8 9.261

4 16 16 19.4481

5 32 32 40.841

6 64 64 85.7661

7 128 128 180.109

8 256 256 378.229

9 512 512 794.28

10 1024 1024 1667.99

11 2048 2048 3502.78

12 4096 4096 7355.83

13 8192 8192 15447.2

14 16384 16384 32439.2

15 32768 32768 68122.3

16 65536 65536 143057

17 131072 131072 300419

18 262144 262144 630881

Enter a numeric value for A(0): 2

Enter a numeric value for A(1): 3

n A(n)=-A[n-1]+A[n-2] 1.5^n 1.8^n

0 2 1 1

1 3 1.5 1.8

2 -1 2.25 3.24

3 4 3.375 5.832

4 -5 5.0625 10.4976

5 9 7.59375 18.8957

6 -14 11.3906 34.0122

7 23 17.0859 61.222

8 -37 25.6289 110.2

9 60 38.4434 198.359

10 -97 57.665 357.047

11 157 86.4976 642.684

12 -254 129.746 1156.83

13 411 194.62 2082.3

14 -665 291.929 3748.13

15 1076 437.894 6746.64

16 -1741 656.841 12144

17 2817 985.261 21859.1

18 -4558 1477.89 39346.4

Beceriler: Her şey Kabul, C Programlama

Daha fazlasını görün: recursive programming, generating sequences recurrence relations, recursive, 2048, 411, 157, write recursive program, recursive program, recursive functions, numeric values

İşveren Hakkında:
( 3 değerlendirme )

Proje NO: #2246240