このディレクトリの索引 相加平均(_値ならび,_相加平均) :- length(_値ならび,_標本数), 相加平均(_値ならび,_標本数,0,_相加平均). 相加平均([],_標本数,_合計,_相加平均) :- _相加平均 is _合計 / _標本数,!. 相加平均([V|R],_標本数,_合計_1,_相加平均) :- _合計_2 is _合計_1 + V, 相加平均(R,_標本数,_合計_2,_相加平均).