题一
1.偶数分量相加:
∑
i
=
1
n
X
2
i
.
\sum_{i = 1}^{n}\mathbf{X}_{2i}.
i=1∑nX2i.
2. 偶数之和:
∑
i
=
1
n
2
i
\sum_{i=1}^n2i
i=1∑n2i
2.1到10的奇数累乘:
∏
i
=
1
10
2
i
−
1
\prod_{i = 1}^{10}2 i -1
i=1∏102i−1
2.积分表达式:
∫
0
10
x
2
+
x
d
x
\int_{0}^{10} x^2 + x \mathrm{d}x
∫010x2+xdx
3.三重累加:
∑
i
=
1
n
∑
j
=
1
i
∑
k
=
1
j
1
\sum_{i=1}^n\sum_{j=1}^i\sum_{k=1}^j1
i=1∑nj=1∑ik=1∑j1
4.计算
∫
0
10
x
2
+
x
d
x
.
\int_{0}^{10} x^2 + x \mathrm{d}x.
∫010x2+xdx.
手算:
≈
383.33
\approx383.33
≈383.33
程序计算:
#include<stdio.h>
int main(){
double delta =0.01;
double ret = 0.0;
for(double i =0;i<=10;i+=delta){
ret += (i*i+i)*delta;
}
printf("%lf",ret);
return 0;
}
5.自己写例子,验证最小二乘法.
令
X
=
[
2
3
1
]
\mathbf{X}=\begin{bmatrix} 2 \\ 3 \\1 \end{bmatrix}
X=⎣⎡231⎦⎤,
Y
=
[
3
4
2
]
\mathbf{Y}=\begin{bmatrix} 3 \\ 4 \\2\end{bmatrix}
Y=⎣⎡342⎦⎤
w = ( X T X ) − 1 X T Y = 1.43 \mathbf{w}=(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{X}^T\mathbf{Y}=1.43 w=(XTX)−1XTY=1.43