Looking for ENG1014 Engineering Numerical Analysis - MUM S2 2025 test answers and solutions? Browse our comprehensive collection of verified answers for ENG1014 Engineering Numerical Analysis - MUM S2 2025 at learning.monash.edu.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
What is the time complexity of the following Python code?
A = np.zeros(5)
n = np.size(A)
for i in range(n):
A[i] = A[i]**2
for j in range(i, n):
A[j] = A[i]/5
print(A)
What is the time complexity of the following Python code?
A = np.zeros(5)
n = np.size(A)
for i in range(n):
A[i] = A[i]**2
for j in range(n):
A[j] = A[i]/5
What is the value of q after the final iteration of the inner most loop when i=30 and k=-3?
for i in range(40):
j = 4
for k in range(5,-5,-1):
s = 5 + j + k
for x in range(5,-9,-3):
q = -x*s
How many times is q calculated in the inner most loop when i=30 and k=-3?
for i in range(40):
j = 4
for k in range(5,-5,-1):
s = 5 + j + k
for x in range(5,-9,-3):
q = -x*s
What is the value of k after the following Python code?
k=0
j=1
for i in range(5):
while j < i:
k += 1
How many times are the while and for loops run in the following code? Count the total number of iterations from both the while loop and for loop.
p = 32
t = 8
while t < p:
t = t + np.floor(p/np.pi)
for k in range(0,10,2):
p = p+2
How many times in total will q be computed in the two for loops?
import numpy as np
q = 1
for i in np.arange(0, 100, np.pi):
q = i*q
for j in np.arange(100,-1,-1):
q = j/np.pi + q
How many times is the while loop run during the final iteration of the for loop?
for i in range(5,1,-1):
k = -5
while k < i:
k = k + 1
i = i - 1
What is the value of count after the following commands?
c = np.array([[6, 1, 4], [2, 1, 5], [3, 7, 1]])
n = len(c)
count = 0
for i in range(n):
for j in range(n):
if i==j and c[i,j]==1:
count += 1