not_IO@lemmy.blahaj.zone to Programmer Humor@programming.devEnglish · edit-21 day agoo(1) statistical prime approximationlemmy.blahaj.zoneimagemessage-square56fedilinkarrow-up1719arrow-down17file-text
arrow-up1712arrow-down1imageo(1) statistical prime approximationlemmy.blahaj.zonenot_IO@lemmy.blahaj.zone to Programmer Humor@programming.devEnglish · edit-21 day agomessage-square56fedilinkfile-text
minus-squareKairos@lemmy.todaylinkfedilinkarrow-up3·11 hours agoThat would make it less accurate. It’s much more likely to return true on not a prime than a prime
minus-squarethemusicman@lemmy.worldlinkfedilinkarrow-up2·5 hours agoCorrect. Not are why people are upvoting. If 10% of numbers are prime in a range, and you always guess false, you get 90% right. If you randomly guess true 10% of the time, you get ~80% right.
minus-squareKairos@lemmy.todaylinkfedilinkarrow-up1·1 hour agoMore random means more towards 50% correctness.
minus-squareptu@sopuli.xyzlinkfedilinkarrow-up1·56 minutes agoAnd 2,3,5,7 are primes of the first numbers, making always false 60% correct and random chance 50%
minus-squareBoomer Humor Doomergod@lemmy.worldlinkfedilinkEnglisharrow-up0·11 hours agoCode proof or it didn’t happen. Extra credit for doing it in Ruby
That would make it less accurate. It’s much more likely to return true on not a prime than a prime
Correct. Not are why people are upvoting. If 10% of numbers are prime in a range, and you always guess false, you get 90% right. If you randomly guess true 10% of the time, you get ~80% right.
More random means more towards 50% correctness.
And 2,3,5,7 are primes of the first numbers, making always false 60% correct and random chance 50%
Code proof or it didn’t happen.
Extra credit for doing it in Ruby