In [1]:
%pylab
%matplotlib inline
In [2]:
3**3
Out[2]:
In [3]:
3**3.1
Out[3]:
In [4]:
3**3.14
Out[4]:
In [5]:
3**pi
Out[5]:
Kan definere $f(x) = 3^x$
In [6]:
x = linspace(-2,2,200)
y1 = 1.1**x
y2 = 2**x
y3 = 3**x
plot(x,y1,x,y2,x,y3)
Out[6]:
In [7]:
x = linspace(-2,2,200)
y1 = 0.8**x
y2 = 0.3**x
y3 = 3**x
plot(x,y1,x,y2,x,y3)
Out[7]:
a negativ? Litt mystisk, komplekse tall, la oss helst ikke gjøre dette!
In [8]:
x = linspace(-2,2,200)
y = (-3)**x
plot(x,y)
Out[8]:
$f(x) = e^x$
In [9]:
x = linspace(-2,2,200)
y = exp(x)
plot(x,y)
axis('equal')
Out[9]:
$e^{2.4}$ er grensen av $(1+2.4/n)^n$:
In [10]:
n = arange(1,5000)
y = (1+2.4/n)**n
plot(n,y)
plot(n,[exp(2.4)]*len(n))
Out[10]:
In [11]:
x = linspace(.3,3,200)
y1 = x**1.2
y2 = x**2
y3 = x**(-2)
plot(x,y1,x,y2,x,y3)
Out[11]:
In [12]:
x = linspace(.1,3,200)
y = x**0.7
plot(x,y)
Out[12]:
For noen ok også for $x <0$:
In [13]:
x = linspace(-2,2,200)
y = x**(-2)
plot(x,y)
Out[13]:
In [14]:
x = linspace(0,100,200)
y = (x**10)/(1.2**x)
plot(x,y)
Out[14]:
Kontinuerlig rentesrente:
In [15]:
p = 0.05
t = 6
# årlig rente:
(1+p)**t
# månedlig rente
(1+p/12)**(12*t)
# daglig rente
(1+p/365)**(365*t)
# kontinuerlig:
exp(p*t)
Out[15]:
In [ ]: