Problem 1. see: http://www.cs.bu.edu/~hwxi/academic/courses/CS320/Fall06/solutions/01/solution1.perl Problem 2. fun fact n = new_if (n > 0, n * fact (n-1), 1) Since Standard ML is call-by-value, it evaluates the terms "n > 0", "n * fact (n-1)", and "1" to values before it calls new_if. Therefore, a recursive call to fact is made regardless of the terminating condition n <= 0, so "fact" loops forever (or more precisely, "fact" loops until memory is consumed up, which should happen given that "fact" is not tail-recursive). Problem 3. fun is_triangle (a: real, b: real , c: real): bool = a + b > c andalso a + c > b andalso b + c > a