Discussion about this post

User's avatar
Lazar Ilic's avatar

Another fairly natural construction, and I am not sure what precise code might benchmark in as fastest in C or C++, would be to imagine the spanned subregion formed by the 2 vectors [1,0] and [x,y] so basically if m and n were your 2 random values then if m+n<=1 we could just take [m+nx,ny] otherwise if m+n>1 then [[1+x]-[m+nx],[y]-[ny]]. Edit later: I was curious about what GPT might say if we instead ask to do this with only 1 random input which can be formalised in to a long double and it was interesting enough. Firstly, it proposed splitting 1 in to 2 by taking every other digit. Then it said instead one could convert the real number in to base 4 and basically note that because triangles can be split in to 4 similar subtriangles under constraints on Lebesgue measure uh one can go through shrinking the output region's area by a factor of 4 each time whilst zeroing in on the final output point. But I know the discretisation permits other natural enough solutions.

Expand full comment
Andy's avatar

Good one

Expand full comment

No posts