OK, I had a hard time coming up with a single sentence title, so please bear with me.

Let’s assume I have a computer with a perfect random number generator. I want to draw from a (electronic) deck of cards that have been shuffled. I can see two distinct algorithms to accomplish this:

  1. Fill a list with the 52 cards in random order, and then pull cards from the list in sequence. That is, defining the (random) sequence of cards before getting them. This is analogous to flipping over cards from a the top of a well-shuffled deck.

  2. Generate a random card from the set that hasn’t been selected yet. In other words, you don’t keep track of what card is going to come up next, you do a random select each time.

Programattically I can see advantages to both systems, but I’m wondering if there’s any mathematical or statistical difference between them.

  • Willie@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    1 month ago

    Well, a little bit of ‘yes’ and a little bit of ‘no’.

    If it is possible over the course of the game for turn orders to be changed, or for a player to choose to draw a card, or cause another player to draw a card, then it matters in a way.

    If I can cause actions to make another player draw a card, then it is more meaningful if the deck is shuffled already, because the card that I caused the player to draw is the same as the card I would have drawn if I drawn a card instead. However, from the perspective of the user, there is no way for them to know the difference.

    I feel like it is better for the integrity of the game if the deck is shuffled for real, though. Because if ever a user finds out that it doesn’t work how it is expected, then it cheapens the experience in a way. Kind of like how the old Mario Party games determined the outcome of dice rolls when the die appeared on screen instead of when you pressed the button to ‘roll’ them.

    • Swordgeek@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 month ago

      If it is possible over the course of the game for turn orders to be changed, or for a player to choose to draw a card, or cause another player to draw a card, then it matters in a way.

      This is a fascinating wrinkle, and quite correct. (and non-obvious, I would say.)

      Everything that people have been posting leans towards laying out the order ahead of time, even if there’s no mathematical difference in drawing the next card.

      (Unless you’re not dealing with a deck of cards, but instead 50k decks at once. :-D )