>>56% Prologモンテカルロ法で√2の近似値を求める(_試行回数,_除数,X) :-    count((for(1,N,_試行回数),U is (random mod _除数) ^ 2,U < _除数 * _除数/ 2),Y),    X is Y / (_試行回数 / 2).