(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



(* ::Input::Initialization:: *)
SetDirectory["C:\\drorbn\\AcademicPensieve\\Talks\\Tokyo-230911"]


(* ::Input::Initialization:: *)
RandomGaussDiagram[n_,as___]:=Module[{i,j,a,is},
is=Range[n];
Graphics[{
Arrowheads[0.015],
Disk[{0,0},0.2],
Arrow@Line[{{0,0},{n+2,0}}],
Arrowheads[0.01],
Flatten@Table[
{i,j}=List@@a[[{2,3}]];
is=Complement[is,{i,j}];
{
a[[1]],
Arrow@BezierCurve[{{i,0},{(i+j)/2,Abs[(i-j)/2]},{j,0}}],
Text[Style[a[[4]],56],{(i+j)/2,Abs[(i-j)/3.3]}]
},
{a,{as}}
],
Black,
Table[
{i,j}=a;
Arrow@BezierCurve[{{i,0},{(i+j)/2,Abs[(i-j)/2]},{j,0}}],
{a, Partition[is[[PermutationList@RandomPermutation@Length@is]],2]}
]
}]
];
RandomGaussDiagram[100,{{Thick, Red},12,30,"R"}]



