Ancestors

Written by Dan Piponi on 2024-11-24 at 00:42

I think this is curious. die() rolls a die. This code almost always returns 3 for large input n.

int depth(int n)

{

if (n == 0)

{

return die(6);

}

return max(

min(depth(n - 1), depth(n - 1)),

min(depth(n - 1), depth(n - 1)));

}

(I have Haskell code to compute the exact prob.)

=> More informations about this toot | More toots from dpiponi@mathstodon.xyz

Written by Dan Piponi on 2024-11-24 at 00:44

I was wondering how much you could control the resulting distribution if the only tools you have available are 6-sided dice and the functions min and max. Looks like you can keep "refining" the distribution to get it as close as you like to being supported at just one value.

=> More informations about this toot | More toots from dpiponi@mathstodon.xyz

Toot

Written by Ray Lee on 2024-11-24 at 03:22

@dpiponi That’s neat. So it’s a sort of… not sure what to call it… emergent distribution? based on the structure of the logic. I like it.

=> More informations about this toot | More toots from 4raylee@mathstodon.xyz

Descendants

Written by Dan Piponi on 2024-11-24 at 03:47

@4raylee I noticed the similarity to logic too. Not sure if there's any mileage you could get out of that.

=> More informations about this toot | More toots from dpiponi@mathstodon.xyz

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113535781026921561
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
261.160309 milliseconds
Gemini-to-HTML Time
0.994101 milliseconds

This content has been proxied by September (ba2dc).