Wednesday

Prove that (sqrt(2) - 1) = 1/(1 + sqrt(2)).

Prove that "(sqrt(2) - 1) = 1/(1 + sqrt(2))".

Some solution steps:

sqrt(2) - 1
= ( sqrt(2)(1+sqrt(2)) - (1+sqrt(2)) ) / (1+sqrt(2))
= ( sqrt(2) + 2 - 1 - sqrt(2) ) / (1+sqrt(2))
= 1 / (1+sqrt(2)) qed.

No comments:

Measure execution time with Julia, example using sorting algorithms

# random integers between 1 and 100 inclusive, generate thousands of them x = rand ( 1 : 100 , 100000 ) @time sort (x; alg=InsertionSort, r...