24/10/05 07:26:15.69 qxAHxNA+.net
>>1
f(x) = 4x
g(x) = 3x + 1
h(x) = 2x²
f.(g.h) = f(3 * 2x² + 1) = 4(6x² + 1) = 24x² + 4
(f.g).h = 4(3 * h(x)+1) = 4(3 * 2x² + 1) = 4(6x² + 1) = 24x² + 4
プログラム(Pythonでの同じ変数への逐次処理も群をなす)
def f(x):
___ans = x
___ans = 2 * ans ** 2
___ans = 3 * ans + 1
___ans = 4 * ans
___return ans