DPL302M (FPTU_AI) EXAM QUESTIONS
AND ANSWERS 2026 VERIFIED.
D - ANS What does the analogy AI is the new electricity refer to?
A: AI is powering personal devices in our homes and offices, similar to electricity.
B: Through the smart grid, AI is delivering a new wave of electricity.
C: AI runs on computers and is thus powered by electricity, but it is letting computers do things
not possible before.
D: Similar to electricity starting about 100 years ago, AI is transforming multiple industries.
Check [relu](https://en.wikipedia.org/wiki/Rectifier_(neural_networks)).
Formula: f(x)=max(0,x) - ANS Which one of these plots represents a ReLU activation function?
D - ANS In this diagram which we hand-drew in lecture, what do the horizontal axis (x-axis)
and vertical axis (y-axis) represent?
A: • x-axis is the performance of the algorithm
• y-axis (vertical axis) is the amount of data.
B: • x-axis is the amount of data
• y-axis is the size of the model you train.
C: • x-axis is the input to the algorithm
• y-axis is outputs.
D: • x-axis is the amount of data
• y-axis (vertical axis) is the performance of the algorithm.
@COPYRIGHT ALL RIGHTS RESERVED PAGE 1 OF 35
,B - ANS What does a neuron compute?
A: A neuron computes an activation function followed by a linear function (z=Wx+b)
B: A neuron computes a linear function (z=Wx+b) followed by an activation function
C: A neuron computes a function g that scales the input x linearly (Wx+b)
D: A neuron computes the mean of all features before applying the output to an activation
function
D - ANS Which of these is the "Logistic Loss"?
A: L(ˆy,y)=|ˆy−y|
B: L(ˆy,y)=max(ˆy−y,0)
C: L(ˆy,y)=|ˆy−y|2
D: L(ˆy,y)=−(ylog(ˆy)+(1−y)log(1−ˆy))
A - ANS Suppose img is a (32,32,3) array, representing a 32x32 image with 3 color channels
red, green and blue. How do you reshape this into a column vector?
A: x = img.reshape((32*32*3,1))
B: x = img.reshape((32*32,3))
C: x = img.reshape((1,32*32*3))
D: x = img.reshape((3, 32*32))
D - ANS Consider the two following random arrays "a" and "b":
```
a = np.random.randn(2, 3) # a.shape = (2, 3)
b = np.random.randn(2, 1) # b.shape = (2, 1)
c=a+b
```
What will be the shape of "c"?
A: c.shape=(3,2)
@COPYRIGHT ALL RIGHTS RESERVED PAGE 2 OF 35
,B: c.shape=(2,1)
C: Error
D: c.shape=(2,3)
C - ANS Consider the two following random arrays "a" and "b":
```
a = np.random.randn(4, 3) # a.shape = (4, 3)
b = np.random.randn(3, 2) # b.shape = (3, 2)
c=a*b
```
What will be the shape of "c"?
A: (3,3)
B: (4,2)
C: Error
D: (4,3)
B - ANS Suppose you have nx input features per example. Recall that X=[x(1),x(2)...,x(m)].
What is the dimension of X?
A: (1,m)
B: (nx,m)
C: (m,nx)
D: (m,1)
D - ANS Recall that `np.dot(a,b)` performs a matrix multiplication on a and b, whereas `a*b`
performs an element-wise multiplication.
Consider the two following random arrays "a" and "b":
```
a = np.random.randn(12288, 150) # a.shape = (12288, 150)
b = np.random.randn(150, 45) # b.shape = (150, 45)
@COPYRIGHT ALL RIGHTS RESERVED PAGE 3 OF 35
, c = np.dot(a, b)
```
What is the shape of c?
A: Shape error
B: (12288, 50)
C: (150, 150)
D: (12288, 45)
C - ANS Consider the following code snippet:
```
# a.shape = (3,4)
# b.shape = (4,1)
for i in range(3):
for j in range(4):
c[i][j] = a[i][j] + b[j]
```
How do you vectorize this?
A: c = a.T + b.T
B: c = a+b
C: c = a + b.T
D: c = a.T + b
A - ANS Consider the following code:
```
a = np.random.randn(3, 3)
@COPYRIGHT ALL RIGHTS RESERVED PAGE 4 OF 35
AND ANSWERS 2026 VERIFIED.
D - ANS What does the analogy AI is the new electricity refer to?
A: AI is powering personal devices in our homes and offices, similar to electricity.
B: Through the smart grid, AI is delivering a new wave of electricity.
C: AI runs on computers and is thus powered by electricity, but it is letting computers do things
not possible before.
D: Similar to electricity starting about 100 years ago, AI is transforming multiple industries.
Check [relu](https://en.wikipedia.org/wiki/Rectifier_(neural_networks)).
Formula: f(x)=max(0,x) - ANS Which one of these plots represents a ReLU activation function?
D - ANS In this diagram which we hand-drew in lecture, what do the horizontal axis (x-axis)
and vertical axis (y-axis) represent?
A: • x-axis is the performance of the algorithm
• y-axis (vertical axis) is the amount of data.
B: • x-axis is the amount of data
• y-axis is the size of the model you train.
C: • x-axis is the input to the algorithm
• y-axis is outputs.
D: • x-axis is the amount of data
• y-axis (vertical axis) is the performance of the algorithm.
@COPYRIGHT ALL RIGHTS RESERVED PAGE 1 OF 35
,B - ANS What does a neuron compute?
A: A neuron computes an activation function followed by a linear function (z=Wx+b)
B: A neuron computes a linear function (z=Wx+b) followed by an activation function
C: A neuron computes a function g that scales the input x linearly (Wx+b)
D: A neuron computes the mean of all features before applying the output to an activation
function
D - ANS Which of these is the "Logistic Loss"?
A: L(ˆy,y)=|ˆy−y|
B: L(ˆy,y)=max(ˆy−y,0)
C: L(ˆy,y)=|ˆy−y|2
D: L(ˆy,y)=−(ylog(ˆy)+(1−y)log(1−ˆy))
A - ANS Suppose img is a (32,32,3) array, representing a 32x32 image with 3 color channels
red, green and blue. How do you reshape this into a column vector?
A: x = img.reshape((32*32*3,1))
B: x = img.reshape((32*32,3))
C: x = img.reshape((1,32*32*3))
D: x = img.reshape((3, 32*32))
D - ANS Consider the two following random arrays "a" and "b":
```
a = np.random.randn(2, 3) # a.shape = (2, 3)
b = np.random.randn(2, 1) # b.shape = (2, 1)
c=a+b
```
What will be the shape of "c"?
A: c.shape=(3,2)
@COPYRIGHT ALL RIGHTS RESERVED PAGE 2 OF 35
,B: c.shape=(2,1)
C: Error
D: c.shape=(2,3)
C - ANS Consider the two following random arrays "a" and "b":
```
a = np.random.randn(4, 3) # a.shape = (4, 3)
b = np.random.randn(3, 2) # b.shape = (3, 2)
c=a*b
```
What will be the shape of "c"?
A: (3,3)
B: (4,2)
C: Error
D: (4,3)
B - ANS Suppose you have nx input features per example. Recall that X=[x(1),x(2)...,x(m)].
What is the dimension of X?
A: (1,m)
B: (nx,m)
C: (m,nx)
D: (m,1)
D - ANS Recall that `np.dot(a,b)` performs a matrix multiplication on a and b, whereas `a*b`
performs an element-wise multiplication.
Consider the two following random arrays "a" and "b":
```
a = np.random.randn(12288, 150) # a.shape = (12288, 150)
b = np.random.randn(150, 45) # b.shape = (150, 45)
@COPYRIGHT ALL RIGHTS RESERVED PAGE 3 OF 35
, c = np.dot(a, b)
```
What is the shape of c?
A: Shape error
B: (12288, 50)
C: (150, 150)
D: (12288, 45)
C - ANS Consider the following code snippet:
```
# a.shape = (3,4)
# b.shape = (4,1)
for i in range(3):
for j in range(4):
c[i][j] = a[i][j] + b[j]
```
How do you vectorize this?
A: c = a.T + b.T
B: c = a+b
C: c = a + b.T
D: c = a.T + b
A - ANS Consider the following code:
```
a = np.random.randn(3, 3)
@COPYRIGHT ALL RIGHTS RESERVED PAGE 4 OF 35