I am looking for help for two things.
- proof of correctness (the tests have passed, but I do not now how to prove it correct)
- Improvements on the Algorithm Efficiency.
The algorithm goes through 2 arrays arrays through permutations. The ordering is set up based on the array index, NOT the number inside the index. Noteably, if both parallel arrrays are set up diffrent, the algorithm should run fine.The algorithm then adds the function to the sum, which estimates computes the series.
Code is below.
def f(x:float, y:float, a:float)->float: """ param x:float, x coordinate param y:flaot, y coordinate param a:float, paramter of the curve """ return x + (y * a) def main(): """ algorithm: Suppouse arrays are orderd by thier index and NOT the element inside Go through an ordering which meets that (one ordering is enough) add on the function at that point to the sequence """ x = [1.0, 2.0, 3.0] y = [2.0, 3.0, 4.0] a = 2.0 seq = [0.0] * len(x) for row in range(0, len(x) + 1): for col in range(0, len(x) + 1): for at in range(row, col): seq[at] = seq[at] + f(x[at], y[at], a) print(seq) if __name__ == "__main__": main()