Computermathematik2_4

431 days ago by PatrickHammer

Übungsblatt_4
WS 2010/11


BEISPIEL 12
def gram(v,inp): w=[] [w.append(v[i]-sum([((inp(w[j],v[i]))/(inp(w[j],w[j])))*w[j] for j in [0,..,i-1]])) for i in [0,..,len(v)-1]] return w view(gram([vector((1,2,3,4)),vector((-1,3,4,0)),vector((1,-1,-1,1))],lambda vi,wj:vi*wj)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left[\left(1,2,3,4\right), \left(-\frac{47}{30},\frac{28}{15},\frac{23}{10},-\frac{34}{15}\right), \left(\frac{115}{491},-\frac{43}{491},\frac{61}{491},-\frac{53}{491}\right)\right]
\newcommand{\Bold}[1]{\mathbf{#1}}\left[\left(1,2,3,4\right), \left(-\frac{47}{30},\frac{28}{15},\frac{23}{10},-\frac{34}{15}\right), \left(\frac{115}{491},-\frac{43}{491},\frac{61}{491},-\frac{53}{491}\right)\right]

BEISPIEL 13
for o in gram([(x^i).function(x) for i in [0,..,10]],lambda p,q:integral(p(x)*q(x),(x,-1,1))): view(o) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ 1
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{2} - \frac{1}{3}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{3} - \frac{3}{5} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{4} - \frac{6}{7} \, x^{2} + \frac{3}{35}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{5} - \frac{10}{9} \, x^{3} + \frac{5}{21} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{6} - \frac{15}{11} \, x^{4} + \frac{5}{11} \, x^{2} - \frac{5}{231}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{7} - \frac{21}{13} \, x^{5} + \frac{105}{143} \, x^{3} - \frac{35}{429} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{8} - \frac{28}{15} \, x^{6} + \frac{14}{13} \, x^{4} - \frac{28}{143} \, x^{2} + \frac{7}{1287}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{9} - \frac{36}{17} \, x^{7} + \frac{126}{85} \, x^{5} - \frac{84}{221} \, x^{3} + \frac{63}{2431} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{10} - \frac{45}{19} \, x^{8} + \frac{630}{323} \, x^{6} - \frac{210}{323} \, x^{4} + \frac{315}{4199} \, x^{2} - \frac{63}{46189}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ 1
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{2} - \frac{1}{3}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{3} - \frac{3}{5} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{4} - \frac{6}{7} \, x^{2} + \frac{3}{35}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{5} - \frac{10}{9} \, x^{3} + \frac{5}{21} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{6} - \frac{15}{11} \, x^{4} + \frac{5}{11} \, x^{2} - \frac{5}{231}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{7} - \frac{21}{13} \, x^{5} + \frac{105}{143} \, x^{3} - \frac{35}{429} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{8} - \frac{28}{15} \, x^{6} + \frac{14}{13} \, x^{4} - \frac{28}{143} \, x^{2} + \frac{7}{1287}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{9} - \frac{36}{17} \, x^{7} + \frac{126}{85} \, x^{5} - \frac{84}{221} \, x^{3} + \frac{63}{2431} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{10} - \frac{45}{19} \, x^{8} + \frac{630}{323} \, x^{6} - \frac{210}{323} \, x^{4} + \frac{315}{4199} \, x^{2} - \frac{63}{46189}

BEISPIEL 14
for o in gram([(x^i).function(x) for i in [0,..,10]],lambda p,q:integral(p(x)*q(x)*exp(-x^2),(x,-oo,oo))): view(o) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ 1
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{2} - \frac{1}{2}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{3} - \frac{3}{2} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{4} - 3 \, x^{2} + \frac{3}{4}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{5} - 5 \, x^{3} + \frac{15}{4} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{6} - \frac{15}{2} \, x^{4} + \frac{45}{4} \, x^{2} - \frac{15}{8}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{7} - \frac{21}{2} \, x^{5} + \frac{105}{4} \, x^{3} - \frac{105}{8} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{8} - 14 \, x^{6} + \frac{105}{2} \, x^{4} - \frac{105}{2} \, x^{2} + \frac{105}{16}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{9} - 18 \, x^{7} + \frac{189}{2} \, x^{5} - \frac{315}{2} \, x^{3} + \frac{945}{16} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{10} - \frac{45}{2} \, x^{8} + \frac{315}{2} \, x^{6} - \frac{1575}{4} \, x^{4} + \frac{4725}{16} \, x^{2} - \frac{945}{32}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ 1
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{2} - \frac{1}{2}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{3} - \frac{3}{2} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{4} - 3 \, x^{2} + \frac{3}{4}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{5} - 5 \, x^{3} + \frac{15}{4} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{6} - \frac{15}{2} \, x^{4} + \frac{45}{4} \, x^{2} - \frac{15}{8}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{7} - \frac{21}{2} \, x^{5} + \frac{105}{4} \, x^{3} - \frac{105}{8} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{8} - 14 \, x^{6} + \frac{105}{2} \, x^{4} - \frac{105}{2} \, x^{2} + \frac{105}{16}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{9} - 18 \, x^{7} + \frac{189}{2} \, x^{5} - \frac{315}{2} \, x^{3} + \frac{945}{16} \, x
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{10} - \frac{45}{2} \, x^{8} + \frac{315}{2} \, x^{6} - \frac{1575}{4} \, x^{4} + \frac{4725}{16} \, x^{2} - \frac{945}{32}