Professional Documents
Culture Documents
Numerical Analysis Laboratory 1 Soca Mirela 9491512
Numerical Analysis Laboratory 1 Soca Mirela 9491512
Numerical Analysis Laboratory 1 Soca Mirela 9491512
Laboratory 1
Task5
1.The code from part A was modified to use the calc_power function that calculates the power
through the 26 resistors. Also the random indexes values are between 1 and 26 and the
reordering for the R vector is updated for this number of resistors.
2. A better solution can be obtained if the value for T variable is made bigger, so that the while
loop runs longer and tries more combinations of random permutations, until T reaches the end
value.
with permutation R = [6 5 14 24 10 8 15 16 5 10 7 7 4 11 20 11 3 10 6 2 14
17 9 2 3 23]