this post was submitted on 18 Aug 2023
11 points (92.3% liked)

Programmer Humor

19488 readers
291 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Napkin math, from the last time I saw this:

I’ve been thinking about this. I estimate a few people per 1000 would do an atrocity for no reason if they were guaranteed no consequences, and the deaths if the switch is pulled are 2^(n-1) for the nth switch. The expected deaths will cross 1 somewhere in the high single-digits, then (since it’s outcome*chance), so the death minimising strategy is actually to pull yours if the chain is at least that long.

Edit: This assumes the length of the chain is variable but finite, and the trolley stops afterwards. If it's infinite obviously you pull the switch.