diff --git a/task1.py b/task1.py new file mode 100644 index 0000000..78b6f0c --- /dev/null +++ b/task1.py @@ -0,0 +1,12 @@ +import numpy as np +import matplotlib.pyplot as plt + +a = np.random.random((1,500)) + +x = np.arange(0.1,100,.1) +y = (1/0.001)* np.log(x) + +#print(y) +#print(a) +plt.plot(x,y) +plt.show() diff --git a/task2a.py b/task2a.py new file mode 100644 index 0000000..f7a3942 --- /dev/null +++ b/task2a.py @@ -0,0 +1,15 @@ +import numpy as np +import matplotlib.pyplot as plt +import time + +start1_time = time.time() + +x = np.random.rand(10) +y = np.random.rand(10) + +#print(x) +#print(y) + +print(x.dot(y)) +print("--- %s seconds ---" % (time.time() - start1_time)) + diff --git a/task2b.py b/task2b.py new file mode 100644 index 0000000..6492bd2 --- /dev/null +++ b/task2b.py @@ -0,0 +1,17 @@ +import numpy as np +import matplotlib.pyplot as plt +import time + +start2_time = time.time() + +x = np.random.rand(10) +y = np.random.rand(10) + +sum = 0 +i=0 +for a in x: + sum = sum + (x[i]*y[i]) + i=i+1 +print(sum) + +print("--- %s seconds ---" % (time.time() - start2_time))