Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
QuinnyCoded@sh.itjust.works to Programmer Humor@programming.dev · 1 day ago

a bit of advice

sh.itjust.works

message-square
36
fedilink
935

a bit of advice

sh.itjust.works

QuinnyCoded@sh.itjust.works to Programmer Humor@programming.dev · 1 day ago
message-square
36
fedilink
alert-triangle
You must log in or register to comment.
  • howrar@lemmy.ca
    link
    fedilink
    arrow-up
    11
    ·
    10 hours ago

    What you want is a distribution-aware contextual binary search. With whatever information you have (appearance, personality, vocabulary, etc), you can come up with a probability distribution in the space of possible ages and start your guess with the value at the 50th percentile. Then depending on whether the true age is higher or lower, your next guess will be either the 25th or 75th percentile. Rinse and repeat.

    In reality, the way most people intuitively do agree guessing is already an approximation of this procedure.

  • Someonelol@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    12
    ·
    12 hours ago

    There’s no right answer to that question. The only winning move is not to play.

    • davetortoise@reddthat.com
      link
      fedilink
      arrow-up
      12
      ·
      11 hours ago

      Jokes on you, refusing to play is also a losing move. The only winning move is to guess 2-3 years less than the correct answer, by sheer luck.

  • Jankatarch@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    11 hours ago

    Watch out, starting at 50 for binary search will fail if they are 100+ years old. Stay woke.

  • GreenBeanMachine@lemmy.world
    link
    fedilink
    arrow-up
    22
    ·
    16 hours ago

    Yes, do it in reverse. Ask her if she’s 25 first, then if she’s 50

  • oni ᓚᘏᗢ@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    13 hours ago

    lol I just realized that everytime I play guessing numbers I do this

  • Randelung@lemmy.world
    link
    fedilink
    arrow-up
    33
    ·
    19 hours ago

    What, and then go 37.5? 24 and 48 are right there.

    • Alcoholicorn@mander.xyz
      link
      fedilink
      arrow-up
      6
      ·
      12 hours ago

      32 is half human life expectancy, and a power of 2.

      • mogranja@lemmy.eco.br
        link
        fedilink
        arrow-up
        1
        ·
        2 hours ago

        Gets my vote

  • 18107@aussie.zone
    link
    fedilink
    English
    arrow-up
    156
    arrow-down
    3
    ·
    1 day ago

    My partner is non-binary, so this search wouldn’t work on them.

    • anton@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      8
      ·
      12 hours ago

      While your partner can’t be found by it, they can be approximated to an arbitrary degree of precision.

    • emotional_soup_88@programming.dev
      link
      fedilink
      English
      arrow-up
      37
      ·
      21 hours ago

      Quantum partner.

    • HexaBack@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      5
      ·
      14 hours ago

      quantum bogosearch

  • furry toaster@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    7
    ·
    16 hours ago

    binary search still works fine, you just need a function probability then you cut at the median, and then rucurse into the slices

  • SpaceCowboy@lemmy.ca
    link
    fedilink
    arrow-up
    20
    ·
    20 hours ago

    Gotta follow Price is Right rules. Closest without going over.

  • marcos@lemmy.world
    link
    fedilink
    arrow-up
    114
    ·
    1 day ago

    Yes, people some times live up to 120 years. You should start at 60.

    • Goodeye8@piefed.social
      link
      fedilink
      English
      arrow-up
      6
      ·
      15 hours ago

      And for obvious reasons I think the minimum age has to be 18 so really you should start at 69 (heh, nice).

      • BartyDeCanter@lemmy.sdf.org
        link
        fedilink
        arrow-up
        1
        ·
        6 minutes ago

        Nice

      • lefaucet@slrpnk.net
        link
        fedilink
        arrow-up
        1
        ·
        11 hours ago

        You have won at the Internet today! Well done!

    • SanctimoniousApe@lemmings.world
      link
      fedilink
      arrow-up
      64
      ·
      edit-2
      1 day ago

      With the limits of longevity still being pushed, I’d suggest sticking with the OP binary search theme and start at 64.

      • marcos@lemmy.world
        link
        fedilink
        arrow-up
        29
        ·
        1 day ago

        Well, round numbers will indeed make the math easier.

        • FuglyDuck@lemmy.world
          link
          fedilink
          English
          arrow-up
          25
          ·
          1 day ago

          If you like round numbers, 69 is all curves.

          • LadyMeow@lemmy.blahaj.zone
            cake
            link
            fedilink
            arrow-up
            7
            ·
            21 hours ago

            What a sexy, sexy number

          • Klear@quokk.au
            link
            fedilink
            English
            arrow-up
            1
            ·
            15 hours ago

            There was something familiar about the number on the desk. The handwriting was all pretty curves.

  • AnarchoEngineer@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    65
    ·
    edit-2
    1 day ago

    Abbott: “So say you’re 40 and you like a girl that’s 10. Well you’re really too old for her because you’re 4x her age. So let’s say you wait 5years. Now you’re 45 and she’s 15, so you’re only 3x as old as her, but that’s still a bit much, so you wait another 15years and now you’re 60 and she’s 30. Only half your age now.

    How long do you have to wait till you’re both the same age?”

    Costello: “Well 4 then 3 then 2… at this rate she’d better be willing to wait for me too.”

    Abbott: “what do you mean?”

    Costello: “Going like this, eventually she’ll be older than me and she better wait for me to catch up.”

    Abbott: “Why would she wait for you?”

    Costello: “WELL I WAITED FOR HER!”

  • MonkderVierte@lemmy.zip
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    18 hours ago

    What now. “Don’t ask a girl her age” but if a girl asks her own age it’s also dangerous?

    • zerofk@lemmy.zip
      link
      fedilink
      arrow-up
      16
      ·
      16 hours ago

      Girls are dangerous.

      • darklamer@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        4
        ·
        12 hours ago

        They have cooties.

        • mogranja@lemmy.eco.br
          link
          fedilink
          arrow-up
          1
          ·
          2 hours ago

          Ewwww

  • JasonDJ@lemmy.zip
    link
    fedilink
    arrow-up
    50
    arrow-down
    1
    ·
    1 day ago

    If she is not 64 then she is 32.

    If she is not 32 then she is 16.

    overthere.sit(self)

    • SanctimoniousApe@lemmings.world
      link
      fedilink
      arrow-up
      52
      ·
      edit-2
      1 day ago

      At 16, she was FAT.
      At 32, she was still FAT32.
      But by 64, she was exFAT.

      • Scubus@sh.itjust.works
        link
        fedilink
        arrow-up
        7
        ·
        23 hours ago

        D:

  • Dudewitbow@lemmy.zip
    link
    fedilink
    arrow-up
    41
    ·
    1 day ago

    the mistake was assuming the upper limit ended at 100

  • qjkxbmwvz@startrek.website
    link
    fedilink
    arrow-up
    30
    ·
    1 day ago

    Obviously you should use an exponential search, assuming you don’t know the age of the oldest human.

    • the rizzler@lemmygrad.ml
      link
      fedilink
      arrow-up
      1
      ·
      1 day ago

      120

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: [email protected]

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.

  • 2.14K users / day
  • 5.03K users / week
  • 7.47K users / month
  • 17.7K users / 6 months
  • 1 local subscriber
  • 28.5K subscribers
  • 2.08K Posts
  • 73K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.9
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org