Appearance
Partial accumulators
In the following, it will be useful to implement partial accumulators as a function of an upper bound index
Exercise 16
Compute accumulator functions for the numerator and the accumulator respectively as:
python
def acc_numerator(i, column,f,sigma,beta, gamma):
value = 1
#Solve here!
return value
def acc_denominator(i, column,f,sigma,beta, gamma):
value = 1
#Solve here!
return value
If implemented correctly, the following check should pass.
python
N_n = acc_numerator(n+1,1,a,sigma,42,42)*acc_numerator(n+1,2,b,sigma,42,42)*acc_numerator(n+1,3,c,sigma,42,42)
D_n = acc_denominator(n+1,1,a,sigma,42,42)*acc_denominator(n+1,2,b,sigma,42,42)*acc_denominator(n+1,3,c,sigma,42,42)
print("When multiplying z for each column with the corresponding upper and lower bounds one should obtain 1:", N_n//D_n==1)