braveandtrue

https://www.braveclojure.com/
2018-08-22T00:09:47.000100Z

The vector doesn’t actually need to be sorted. If body part 1 takes up 10 “units”, and body part 2 takes up 5, body part 1 is going to have twice as many opportunities to get hit as body part 2, just because it’s twice as big

2018-08-22T00:10:37.000100Z

It’s the relative size that counts.

moo 2018-08-22T13:27:16.000100Z

Hmm, I’m still not getting why this wouldn’t happen:

[1 1 1 1 1 1 1 2 2 3 3 3 3 3 3 3 3 3 4 4 4 5 5 5 5 5 5 5 5 5 ]
[= = = = = = = = = = = = = = = = = = = ^                     ] ;; target
In the above, we get to a smaller body part, because of the way the vect was ordered

2018-08-22T14:26:51.000100Z

Yup, in the above list, you have 3 chances out of 30 to hit body part 4, 2 chances out of 30 to hit body part 2, and so on. So sometimes you'll hit the smaller body part. The target is random, so you'll randomly hit big body parts some times, and small body parts other times, but as you keep hitting different parts, you'll notice you hit the bigger parts more often, because they have more chances to be hit.

1
2018-08-22T14:32:09.000100Z

The parts don't need to be sorted in order of size, which means small values for target don't necessarily imply hitting small body parts. That's not where the statistical odds come from. Where you get the "hit bigger parts more often" is from the fact that there are more values of target that correspond to hitting a large body part, i.e. there's (...counting...) 7 different values that target could be that would give you a hit on body part 1, but only 2 possible values for target that would indicate a hit on body part 2. So on average, over time, you're going to hit bp1 about 7 times out of 30, and bp2 only 2 times out of 30.

👍 2
moo 2018-08-22T14:49:24.000100Z

Oh, it’s a combinatorics thing I missed not a clojure thing. Yeah that makes sense. Thank you!

👍 4