- 将向量下标为偶数的分量
(
x
2
,
x
4
,
…
)
(x_2, x_4, …)
(x2?,x4?,…) 累加, 写出相应表达式.
①
∑
i
%
2
=
0
x
i
\sum_{i\%2=0} x_i
i%2=0∑?xi? ②
∑
i
=
1
?
2
/
n
?
x
2
i
\sum_{i=1}^{\lfloor{2/n}\rfloor} x_{2i}
i=1∑?2/n??x2i?
- 累加习题:求 1! + 2! + 3! +
…
\dots
… + 20! 。
∑
i
=
1
20
i
!
\sum_{i=1}^{20}i!
i=1∑20?i!
int sum = 0;
int t = 1;
for(int i = 1; i < 21; i++)
{
t *= i;
sum += t;
}
输出: 1!+2!+3!+……+20! = 2561327494111820313
累乘习题:求 1! * 2! * 3! *
…
\dots
… * 20! 。
∏
i
=
1
20
i
!
\prod_{i=1}^{20}i!
i=1∏20?i!
int res = 1;
int t = 1;
for(int i = 1; i < 21; i++)
{
t *= i;
res *= t;
}
积分习题:
∫
1
20
x
3
+
2
d
x
\int_{1}^{20} x^3+2 dx
∫120?x3+2dx
double integration = 0;
double delta = 0.0001;
for(double x = 1; x <= 20; x += delta)
integration += (x * x * x + 2) * delta;
-
三重累加 三重积分:计算
I
=
∫
∫
∫
Ω
z
d
v
,
Ω
:
z
=
x
2
+
y
2
,
z
=
1
,
z
=
2
I = \int\int\int_{\Omega}zdv, \Omega:z=\sqrt{x^2 + y^2}, z = 1, z = 2
I=∫∫∫Ω?zdv,Ω:z=x2+y2
?,z=1,z=2 围城的区域。
I
=
∫
∫
∫
Ω
z
d
v
=
∫
1
2
z
d
z
∫
∫
D
1
d
x
d
y
D
1
=
{
(
x
,
y
)
∣
0
≤
x
2
+
y
2
≤
z
2
}
I = \int\int\int_{\Omega} zdv = \int_1^2 zdz \int\int_{D_1} dxdy \\ D_1 = \{(x, y) \vert 0 \leq x^2+y^2 \leq z^2\}
I=∫∫∫Ω?zdv=∫12?zdz∫∫D1??dxdyD1?={(x,y)∣0≤x2+y2≤z2}
=
∫
1
2
z
d
z
∫
∫
D
1
d
x
d
y
=
∫
1
2
π
z
3
d
z
=
15
π
/
4
= \int_1^2 zdz \int\int_{D_1} dxdy = \int_1^2 \pi z^3 dz = 15 \pi/4
=∫12?zdz∫∫D1??dxdy=∫12?πz3dz=15π/4 -
有如下积分。
∫
0
10
x
+
2
d
x
\int_{0}^{10} x+2 dx
∫010?x+2dx
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
double integration = 0;
double delta = 0.0001;;
clock_t startTime, endTime;
startTime = clock();
for(double x = 0; x <= 10; x += delta)
integration += (x + 2) * delta;
endTime = clock();
cout << integration << endl;
cout << (double)(endTime - startTime) / CLOCKS_PER_SEC << endl;
}
手算 = 70 程序 = 70.0007
- 验证最小二乘法见 最小二乘法
- 逻辑回归推导见 逻辑回归推导
|