not_IO@lemmy.blahaj.zone to Programmer Humor@programming.devEnglish · edit-22 days agoo(1) statistical prime approximationlemmy.blahaj.zoneimagemessage-square52fedilinkarrow-up1827arrow-down17file-text
arrow-up1820arrow-down1imageo(1) statistical prime approximationlemmy.blahaj.zonenot_IO@lemmy.blahaj.zone to Programmer Humor@programming.devEnglish · edit-22 days agomessage-square52fedilinkfile-text
minus-squareKairos@lemmy.todaylinkfedilinkarrow-up4·17 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·10 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·7 hours agoMore random means more towards 50% correctness.
minus-squareptu@sopuli.xyzlinkfedilinkarrow-up3·7 hours 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-up2·16 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