summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.idea/misc.xml4
-rw-r--r--.idea/modules.xml8
-rw-r--r--.idea/vlog.iml8
-rw-r--r--double_11.py19
-rw-r--r--readme.md6
5 files changed, 45 insertions, 0 deletions
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..65531ca
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
+</project> \ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..96c2fc7
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/vlog.iml" filepath="$PROJECT_DIR$/.idea/vlog.iml" />
+ </modules>
+ </component>
+</project> \ No newline at end of file
diff --git a/.idea/vlog.iml b/.idea/vlog.iml
new file mode 100644
index 0000000..f8446a8
--- /dev/null
+++ b/.idea/vlog.iml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$" />
+ <orderEntry type="jdk" jdkName="Python 3.7 (py3) (1)" jdkType="Python SDK" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module> \ No newline at end of file
diff --git a/double_11.py b/double_11.py
new file mode 100644
index 0000000..118cfb7
--- /dev/null
+++ b/double_11.py
@@ -0,0 +1,19 @@
+
+import numpy as np
+import matplotlib.pyplot as plt
+
+years = [y+2009 for y in range(11)]
+gmvs = [0.5, 9.36, 52, 191, 350, 571, 912, 1207, 1682, 2135, 2684]
+
+
+def polynomial(xs, ys, n):
+ f = np.polyfit(xs, ys, n)
+ def func(x):
+ return sum(f[i]*x**(n-i)for i in range(n+1))
+ return func
+
+f = polynomial(years, gmvs, 3)
+print(f(2020))
+
+plt.plot(years, gmvs, marker='o')
+plt.show() \ No newline at end of file
diff --git a/readme.md b/readme.md
index e69de29..8a990da 100644
--- a/readme.md
+++ b/readme.md
@@ -0,0 +1,6 @@
+
+- monte_carlo_triangle.py, [【计算机科学】蒙特卡洛方法计算“一棍砍两刀”构成三角形的概率](https://www.bilibili.com/video/av75100858/)
+- double_11.py
+
+
+