Skip to content

Instantly share code, notes, and snippets.

View theran's full-sized avatar

Louis Theran theran

View GitHub Profile
@theran
theran / L24.txt
Created March 25, 2023 16:51
Magma code accompanying the paper "Trilateration using Unlabeled Path or Loop Lengths"
/****************************************************************************/
/* Properties of varieties L24 and L35 */
/* */
/* To run, launch magma and type: load "<yourpath>/L24.txt" */
/* */
/* Accompanies manuscript: */
/* I. Gkioulekas, S. J. Gortler, L. Theran, and T. Zickler, "Determining */
/* Generic Point Configurations From Unlabeled Path or Loop Lengths," */
/* 2017. */
/* */
RandomIntPoints[n_, d_, b_] :=
Table[RandomInteger[2^b], {n}, {d}]
RandomFloatPoints[n_, d_] :=
RandomVariate[NormalDistribution[], {n, d}]
SparseRigidityMatrix[g_Graph, d_, P_List] :=
Module[{ptrules, edgerules},
@theran
theran / riddle.nb
Created December 22, 2015 17:08
538 riddle
In[1]:= Riddle[tasksL_, tasksR_, timeL_, timeR_] :=
If[timeL == timeR,
{tasksL, tasksR, timeL, timeR},
If[timeL < timeR,
Riddle[tasksL + 1, tasksR, timeL + RandomInteger[{1, 5}], timeR],
Riddle[tasksL, tasksR + 1, timeL, timeR + RandomInteger[{1, 5}]]]]
In[24]:= X =
Table[Riddle[1, 1, RandomInteger[{1, 5}],
RandomInteger[{1, 5}]], {50000}];