2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

Klausur 6, Aufgabe 2 gelöst

This commit is contained in:
Martin Thoma 2013-09-21 19:57:23 +02:00
parent dffdc90747
commit 69e79a440d
3 changed files with 13 additions and 27 deletions

View file

@ -61,14 +61,9 @@ gilt:
\Rightarrow \forall x, y \in [0,1]: |F(x) - F(y)| &< \frac{1}{2} |x-y|
\end{align}
$F_2$ ist auf $(0,1]$ eine Kontraktion mit Kontraktionszahl $\theta$:
\begin{align}
\|- \ln (2x) + \ln(2y) \| &\leq \theta \cdot \|x-y\|\\
\Leftrightarrow \| \ln(\frac{2y}{2x}) \| &\leq \theta \cdot \|x-y\|\\
\Leftrightarrow \| \ln(\frac{y}{x}) \| &\leq \theta \cdot \|x-y\|
\end{align}
TODO: Beweis ist nicht mal wirklich angefangen
Die Ableitung $F_2' = -\frac{1}{x}$. Da $F_2(1) \neq 1$ ist $x^* \neq 1$.
Also ist $|F_2'(x^*)| > 1$. Deshalb konvergiert das Iterationsverfahren
definiert durch $F_2$ nicht gegen $x^*$ für Startwerte ungleich $x^*$.
Gegen $F_2$ spricht auch, dass $\log$ nur auf $\mathbb{R}^+$ definiert
ist. Das kann bei Rundungsfehlern eventuell zu einem Fehler führen.

View file

@ -1,22 +1,13 @@
"""from math import exp, log
from math import exp, log
def iterate(x):
#return x - (2.0*x - exp(-x))/(2.0+exp(-x)) #Newton
#return 0.5*exp(-x) #F_1
return (-1)*log(2.0*x) #F_2
def iterate(x, times=1):
#x = x - (2.0*x - exp(-x))/(2.0+exp(-x)) #Newton
x = 0.5*exp(-x) #F_1
#x = (-1)*log(2.0*x) #F_2
x = 0.9
for i in range(10):
print (i, x)
x = iterate(x)
"""
from math import log
f = lambda x: -log(2*x)
if times > 0:
x = iterate(x, times-1)
return x
x = 0.35173371124919582602
#x = 0.3517337112491958260249093009299510651715
for i in range(200):
print("x 0.35173371124919582602")
print("x 0.3517337112491958260249093009299510651715")
print("%i %.30f" % (i, x))
x = f(x)
print(iterate(0.5,6))