# Name: E.M.D.A. Bandara
# Index No: 190072E


```python
for i in range(1, 6):
  print("%d : %d"%(i, i**2))
```

    1 : 1
    2 : 4
    3 : 9
    4 : 16
    5 : 25



```python
import sympy
for i in range(1,6):
  if not sympy.isprime(i):
    print(i,' :', i**2)
```

    1  : 1
    4  : 16



```python
squares = [i**2 for i in range(1,6)]
for i in range(5):
  print(i+1, ": ", squares[i])
```

    1 :  1
    2 :  4
    3 :  9
    4 :  16
    5 :  25



```python

print('H')
```

    H



```python
import numpy as np

matA = [[1, 2],[3, 4],[5, 6]]
matB = [[7, 8, 9, 1], [1, 2, 3, 4]]


matA = np.array(matA)
matB = np.array(matB)

print(matA.shape)
print(matB.shape)

matMul = np.matmul(matA, matB)
print(matMul)

```

    (3, 2)
    (2, 4)
    [[ 9 12 15  9]
     [25 32 39 19]
     [41 52 63 29]]



```python
matA = [[1, 2], [3, 4], [5, 6]]
matB = [[3, 2], [5, 4], [3, 1]]

matDot = np.multiply(matA, matB)
print(matDot)
```

    [[ 3  4]
     [15 16]
     [15  6]]



```python
A = np.random.randint(10, size=(5, 7))
print(A)
```

    [[0 8 1 6 2 2 6]
     [9 7 5 0 0 7 6]
     [7 2 8 7 5 9 4]
     [0 1 6 1 5 7 9]
     [9 6 3 5 7 4 5]]



```python
import matplotlib.pyplot as plt
from numpy import linalg

m, c = 2, -4
N = 100
x = np.linspace(0, N-1, N).reshape(N, 1)
sigma = 10
y = m*x + c + np.random.normal(0, sigma, (N, 1))

plt.scatter(x, y)

x = np.append(np.ones((N, 1)), x, axis = 1)

w = linalg.inv(x.T @ x) @ x.T @ y
```


```python
import cv2 as cv

```


```python

```

1be8bfcfd5d6b6090da56a39e3570de6885ee02c
ipynb
Jupyter Notebook
Homeworks/HW_1/Image_processing_02_02.ipynb
Dumindu-Bandara/EN2550-Fundamentals-of-Image-Processing-and-Machine-Vision
d4b5c4e9527549c124bf08109ea8d3f323829496
MIT
Homeworks/HW_1/Image_processing_02_02.ipynb
Dumindu-Bandara/EN2550-Fundamentals-of-Image-Processing-and-Machine-Vision
d4b5c4e9527549c124bf08109ea8d3f323829496
MIT
Homeworks/HW_1/Image_processing_02_02.ipynb
Dumindu-Bandara/EN2550-Fundamentals-of-Image-Processing-and-Machine-Vision
d4b5c4e9527549c124bf08109ea8d3f323829496
MIT
Qwen/Qwen-72B
1. YES
2. YES