Commits

Yaron Minsky committed 4128140

fixed some bugs

  • Participants
  • Parent commits c4882bb

Comments (0)

Files changed (2)

ocaml/experiments.ml

   loop ~times 0 // times
 
 let ratio1 n m =
+  let scramble = P.rand n in
+  let cyc = scramble ++ P.rot1 n ++ P.inverse scramble in
   succ_ratio m (fun () ->
-    let scramble = P.rand n in
-    P.is_cycle (scramble ++ P.rot1 n ++ P.inverse scramble)
+    P.is_cycle (P.involution n ++ cyc)
   )
 
 let ratio2 n m =
     |> sexp_of_exp1 |> Sexp.to_string_hum |> print_endline
   )
 
-let () = exp1 10_000
+let () =
+  Random.self_init ();
+  exp1 10_000
         c2 = float(count2(N,M))
         print "N=",N," C1:",c1/M, "C2: ",c2/M, "C1^2: ", (c1/M)*(c1/M)
 
+exp1(M)
 
 # for N in range(2,40,2):
 #     c1 = count1r(N,M)