MTGZone
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
SomeBoyo@feddit.de to Programmer Humor@programming.dev · 2 years ago

It gets better the longer it runs

feddit.de

message-square
14
fedilink
34

It gets better the longer it runs

feddit.de

SomeBoyo@feddit.de to Programmer Humor@programming.dev · 2 years ago
message-square
14
fedilink
  • Xylight (photon dev)@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    2 years ago

    How long would this have to run for it to round up to 100%?

    • xthexder@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      A few calculations:

      • There are 9592 prime numbers less than 100,000. Assuming the test suite only tests numbers 1-99999, the accuracy should actually be only 90.408%, not 95.121%
      • The 1 trillionth prime number is 29,996,224,275,833. This would mean even the first 29 trillion primes would only get you to 96.667% accuracy.
      • The density of primes can be approximated using the Prime Number Theorem: 1/ln(x). Solving 99.9995 = 100 - 100 / ln(x) for x gives e^200000 or 7.88 × 10^86858. In other words, the universe will end before any current computer could check that many numbers.
    • Hexarei@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      This is a really fun question and now I’m nerd sniped

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 104 users / day
  • 3.68K users / week
  • 10.1K users / month
  • 19.8K users / 6 months
  • 5 local subscribers
  • 24.7K subscribers
  • 1.54K Posts
  • 55.9K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org