Informatics1-2018/HW6

A MathWikiből
(Változatok közti eltérés)
Gaebor (vitalap | szerkesztései)
(Új oldal, tartalma: „== 1. Exercise == '''3 points''' The [https://en.wikipedia.org/wiki/Collatz_conjecture Collatz] or ''3n+1'' problem is the following: * Let ''n'' be a positive integer…”)
Újabb szerkesztés →

A lap 2018. november 20., 21:14-kori változata

Tartalomjegyzék

1. Exercise

3 points

The Collatz or 3n+1 problem is the following:

  • Let n be a positive integer.
  • Let g(n) = n/2 is n is even and 3n+1 is odd.
  • Then one can iterate g over-and-over for any given number. For example starting with 98:
{98, 49, 148, 74, 37, 112, 56, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1}

It is an interesting and unproven conjecture that starting from any number, you will reach 1 sooner or later. In the example above it took 25 steps. For example 5 -> 16 -> 8 -> 4 -> 2 -> 1 takes 5 steps.

Plot the number of steps needed to reach one against n, use ListPlot and n=1...1000

Collatz.png

2. Exercise

a)

3 points

Define a function T with three arguments:

  • f a function
  • n a natural number
  • x0 a real number

For this values calculate the nth Taylor polynomial of f around x0.

For example:

In[1]:=  T[Exp,4,0]
Out[1]:= 1 + x + x^2/2 + x^3/6 + x^4/24

Note that there is a buit-on function Series which does exactly this, but don't use that, implement it on your own! Use the sum symbol from the paletta and the Derivative.

b)

3 points

Ábrázoljuk a e^{-x^2} függvény deriváltjait egy Plot-on. Egy adott M-hez készítsük el azt az ábrát, ahol az f, f', f'' \ldots f^{(M)} ábrázolva van a [ − 2,2] intervallumon (ez összesen M+1 darab függvény). Használjunk Manipulate-et az M állítására.

Gaussian.png

Beküldés

Határidő: 2018.11.25 23:59

A megoldást egy Mathematic notebook formájában mellékeljétek a levélhez, ilyen névvel (A kurzus kódját és a login-nevet ki kell cserélni a sajátotokra):

T0_borbely_HF6.nb
Személyes eszközök