This is not how they work: a slot machine is secretly pre-programmed to have the next 48 plays be losing plays and then pay a jackpot on the 49th play.
This is how they work: whether or not you win or lose depends a random number generated when you pull the lever (erm, push the button). For example, it might be the last two digits of the exact millisecond that you pull the lever, but you have no clue what that is.
My point is: slot machines have no a priori knowledge of when it is going to pay out.
That brings me to this point: any time you draw a card from your deck, does MTGO know ahead of time what card you're going to draw? Or does it depend on the exact millisecond that you draw the card? The reason I ask this is because whenever you search your library for a card, you see all the cards in your library in a neat order rather than some random order that implies the order of your deck.
(People always complain about the "shuffler". But is that a metaphor for always having unlucky random numbers that determine your draw step?)
Here's my situation. I recently played in a game where I was pretty far behind; I had one draw step left before my opponent kills me. Since I control Thassa, God of the Sea I get to scry before I draw my last card of the game. If this draw doesn't help me win, I lose the game.
I scry and it's Master of Waves. I already control one Master of Waves and a bunch of tokens so this second one will give an additional boost to the ones that are eligible to attack this turn. But he's also got plenty of blockers, so I need to make sure I have enough mana to make enough things unblockable.
I do the math, I have exactly enough mana to do everything I want, so I keep the Master of Waves on top and draw it. As soon as I draw it, it dawns on me that I actually didn't have enough mana; I'm going to lose the game now.
I concede the game and then hit the "draw next card" button after the game is over. It's a Nightveil Specter that's largely irrelevant to the math on board. In fact, my only outs were an overloaded Cylonic Rift or Curse of the Swine to remove the Thassa on the other side.
Since the next card was Nightveil Specter, I can take solace in the fact that at least my mistake in counting didn't cost me the game. Even had I scryed the second Master of Waves to the bottom, I would've drawn this useless Nightveil Specter instead.
But then I'm thinking, is that how it really works? Was Nightveil Specter the next card in my library all along? Or is the next card not determined until I ask to see it?
Isn't that how contents of booster packs are determined? The game doesn't know what's inside the pack until you ask to open it. I think that is the way that works because of something to do with preserving the print run in limited tournaments.
MTGO boosters simulating real printrun sequences too.
Seriously? When did I ever even imply boosters are random? I thought that such a thing as a print run existing is pretty much common knowledge these days.
I'm talking about where you are in the print run when you open the booster pack.
If you have a physical pack, then the cards in there are not going to change: you don't know what they are but the contents don't change based on which millisecond you open it (or some other pre-determined measure).
However, isn't it the case that the contents of a pack on MTGO does depend on the millisecond that you open it?
For example, say I own 12 packs in my collection and then I traded 5. How does the machine know which 5 to give away and which 7 to keep? Isn't the answer that it doesn't matter since there's nothing inside the packs until after you open them anyway?
Without specific knowledge of the programming (which I doubt any commenter here would have), I would tend to think that each time there is a shuffle effect, the cards remaining in the library are set in a random order. Each card pull can't be instantaneously randomized, as that would mess with scry-type effects that allow you to place cards in a specific place in your library.
When you are allowed to view your entire library, the program understands that you are likely looking for specific information (say, you landed Kor Cartographers and can get a Plains out), so it sets out those specific cards in an easy to grab format, but shows you everything else as well (since you are entitled to see the entire contents of your library on any search). I can't say whether that portion of the library view is the same random order as the shuffle effect placed your deck or not.
TL;DR: It's safe to assume that Nightveil Specter was always the next card in your library. No Schrodenger's Card here.
Each card pull can't be instantaneously randomized, as that would mess with scry-type effects that allow you to place cards in a specific place in your library.
Obviously, known parts of the deck will always remain known and the probability of each card pull is adjusted for that.
Suppose that I had 48 cards remaining in my library. My deck contains 4 Master of Waves, but I already have one in play. Then I scry and see another Master of Waves.
If I made the correct play and move that to the bottom of the deck, then would it be that hard to program the game to understand that now the next card pull has a 2/47 chance (instead of a 3/48 chance) of being yet another Master of Waves?
To me, it wouldn't be that hard for the computer to hold these two pieces of information handy:
Order of dgschess' library:
[Unknown card]
[Unknown card]
[Unknown card]
[Unknown card]
[Unknown card]
[Unknown card]
[Unknown card]
[Unknown card]
[Unknown card]
[Unknown card]
[Unknown card]
Master of Waves
List of unknown cards to choose from in dgschess' library:
2 copies of Master of Waves
2 copies of Nightveil Specter
3 copies of Thassa, God of the Sea
14 copies of Island
etc
I'm no computer expert, but it seems plausible, no?
Logically, the deck is likely shuffled and kept in that order until it is reshuffled. Consider that in Magic it is common to put cards back on top of library, to reorder top cards and to put cards on the bottom. It makes little sense to implement on-demand randomness for the unknown part of the deck while tracking the positions of known cards in the deck throughout the game. It is highly likely that the order is decided by every shuffle action.
When you search your library, it is probably just providing you a conveniently sorted view (since it is about to reshuffle the library anyway).
This approach is hinted to in an early post about the MTGO shuffler from Chris Green of Leaping Lizard Software (the original MTGO developers):
MTGO's Shuffle Algorithm...get the technical low down...
March 15, 2002
by Chris Green
A technical description of Magic Online's shuffler and random number generator.
The core random number generator used is "Algorithm A", from Knuth's "Art of Computer Programming", sec 3.2.2. This is a fast, easy to implement random number generator. Knuth states that it has "consistently produced reliable results, in extensive tests since its invention in 1958."
I first implemented this generator in 6502 assembly code in 1981 or so, and it has never failed me.
The implementation of this generator used in our libraries uses the standard constants (24,55). Because this is somewhat fewer than the number of bits required to produce all possible hands, it was augmented with another generator using the constants (33,68). This yields a total state size of 3936 bits. Both generators were combined so that the random number calls used in our library could still return the same sequence of numbers when initiated by our old programs (never know when we might have to rebuild a new version of Centipede3D for the Dreamcast ).
In MTGO, random numbers are initialized by the game servers. When a new game is started, the random number state is seeded via /dev/random, which uses hardware delays for a source of true random data. In addition, whenever a packet is received from a user by the game server, the lower order bits of the system CPU's clock cycle counter are added into the random state.
Shuffling is performed by swapping every card in the deck with a random other card in the deck. This is algorithm "P" for shuffling from Knuth. The book contains a formal analysis of its randomness. The 32 bit random values returned by the basic random number function are mapped into the appropriate range by fixed point multiplication.
One of our programmers, Sergey, was not satisfied that the random number generator wasn't mana-screwing him, and so performed the following test:
The shuffler has no idea what is a land and is not a land, so if there is any unnatural clumping of lands, it must be based upon the initial ordering of the deck. So he performed the following test:
Create in memory a virtual deck of 20 "1"s, representing lands, and 40 "0"s representing non-lands. Put all the "lands" first and then all the "nonlands". Apply the shuffler.
Perform the same test, except with lands and nonlands interleaved before shuffling.
Perform each test multiple millions of times. After each test, count the sizes of land/non-land clusters and keep a running total of each.
Compare the results from the millions of runs with the deck ordered with all lands together versus the interleaved one. The results were the same to within a minuscule fraction of a percent.
In addition, he wished to verify that shuffling extra times would have no effect. If it did have an effect that would mean that the shuffle was insufficiently random. He performed this test and got the same statistics from one shuffle as from many.
Thanks, MTG Apps for that. I guess the main thing about my logic was that any time you search your deck, it shows you every card in neat order.
Certainly, you're allowed to see the contents of your deck when you search but there's no real guarantee that you're allowed to see the contents in order. Nonetheless, this is largely irrelevant because you should know the contents of your own deck anyway (or write them down). I guess this is just one of the many ways where MTGO is different than real Magic.
The thing about the boosters is right though, right? The boosters don't actually contain any cards but rather serve as an IOU for 15 cards when you choose to claim those cards (i.e., open the pack)? When you open a pack, you're really trading in this IOU note and getting 15 cards in exchange rather than actually revealing any contents?
It's also worth noting that while Nightveil Specter was always the top card of your library, your mistake wouldn't have been worse in any way. I know it's easy to think about it like that, as human brains try to handle randomness rather illogically, but really, what we're evaluating is your choice, and that was independent of the top card of your library.
It's also worth noting that while Nightveil Specter was always the top card of your library, your mistake wouldn't have been worse in any way. I know it's easy to think about it like that, as human brains try to handle randomness rather illogically, but really, what we're evaluating is your choice, and that was independent of the top card of your library.
I'm familiar with how probability works.
If the purpose of the game was to practice to become a better player, then the mistake is equally bad, regardless of whether it ended up making a difference. If the purpose was the endgame of all preparation (that is, if this was the major event that I was preparing for), then it's worth noting exactly how much that single mistake cost.
If a football player (say, cornerback) blows his coverage assignment during a preseason game and then wide open receiver happens to drop the pass, the fact of the matter is that the corner needs get better at his coverage because the next time, the receiver might not drop it. If this same football player makes a mistake on his assignment during the fourth quarter of the Super Bowl (in the final year of his career), then it's pretty relevant whether the receiver makes the catch or not.
You say we're evaluating my choice, but we're not. I already know I made the wrong choice. That's not up for debate, I already know I was wrong: it's why I conceded; that's why I made this post!
I had four outs in my deck with approximately 48 cards remaining. I just wanted to know how much my wrong choice cost me: if my mistake cost me the 0% of the grand prize at the end (since I was going to draw the Nightveil Specter anyway), or 44/48 of the grand prize (since those are my odds that I draw a dead card).
But actually, none of the above is the real reason for this post.
The real reason for this post was to see if anyone had insight on whether the game knows the order of my library at all times, or if it does this "Schrodenger's [sic] Card" that CommiePuddin mentioned.
It comes from a genuine curiosity of how the game is coded/written; perhaps I should've asked the question without the backstory.
To random draw all the time you have to:
-Have a special-case list for whenever someone manipulates the library on top
-on bottom
-three from the top
-etc..
To do that, you'd be creating an ordered list. In fact, there are many cards in the game that result in a combo that orders your *entire library.*
From a programmer's point of view then, there's absolutely no reason to randomize the draw *ever*, because it costs extra work for the same probability of outcomes.
Thus, no reason to play with it. As someone who programs frequently (it's my job..) wasting time on useless code that saves you no code and gains you no real benefit is completely illogical; and we're basically just arbiters of logic that use machines to do it.
To random draw all the time you have to:
-Have a special-case list for whenever someone manipulates the library on top
-on bottom
-three from the top
-etc..
To do that, you'd be creating an ordered list. In fact, there are many cards in the game that result in a combo that orders your *entire library.*
From a programmer's point of view then, there's absolutely no reason to randomize the draw *ever*, because it costs extra work for the same probability of outcomes.
Thus, no reason to play with it. As someone who programs frequently (it's my job..) wasting time on useless code that saves you no code and gains you no real benefit is completely illogical; and we're basically just arbiters of logic that use machines to do it.
Pretty much this. If magic didn't have ways to predetermine parts of your library (Scry, Unexpectedly Absent, Cascade) you could make it so that when you draw the game randomly gives you a card. With the library interaction it becomes far more complex to build those exception cases when you could just generate the deck once whenever it is shuffled.
Creating a program to shuffle a deck and keep it in order is rather easy. Any experienced programmer could do it in under an hour. If you give it the other special cases it basically triples the work and uses more memory overhead for no reason.
Q: I have a question that is perhaps of the more philosophical nature. When you buy a booster "in real life" the cards are already determined, i.e. it doesn't matter when you open the booster, the cards will always be the same. But when you buy, or win, a booster on MTGO, when is it determined what the booster contains? If you could open the same booster at two different time points, will they contain the same cards, or are they randomized the moment you open the pack?
–Håkan, Uppsala, Sweden
A: From Lee Sharpe, Magic Online programmer:
Hello, Håkan!
A booster pack on Magic Online is simply a digital object that you can "open," which removes it from the system and replaces it with 15 cards. So the answer to your question is that the cards "in" a pack are determined when it's opened, not when it's purchased from the Magic Online store. This is true whether your open the packs yourself or use them to play in a Sealed Deck, Booster Draft, or league.
As you might suspect, opening a booster now instead ten minutes from now will most likely result in a different set of 15 cards. In effect what this means is that by looking to see what cards you got in your pack, you are changing which cards are in the pack. Schrödinger would be proud.
I always suspected this was the case since you could own fifteen boosters and when you traded three of them away, it doesn't ask you which three you want to trade and which twelve you want to keep.
I just figured since this is how booster packs work, this might be how other unknowns (order of deck) were handled.
there is a difference between a known set (your library or deck of cards of which you know the contents of beforehand) and a set that is to be determined (unopened fresh pack.)
as said above, a known deck is much easier to handle (for both the human and computer) if you keep the cards in a known, consistent order i.e. not randomized for each draw. this way, you can sort it any way you want without messing with the original order. make a copy of the deck, sort it, and show it to the player. this is just a copy, it doesn't affect the original order. repeatedly, unnecessarily shuffling or randomizing is a waste of time and resources.
OTOH, a fresh pack isn't a known set, and so there is little reason to make the contents known before it's opened. a major reason is to save memory and disk space. i imagine that data for a single (unopened) pack would take a lot less space than 15 cards (even more for tournament decks and intro decks). not only that, cards require more information (e.g. which set, foil or not, etc.) another reason may be other types of flags or settings, like ownership. i.e. who owns the unknown cards? when you open your collection, the program would have to hide these unopened cards, which is yet another unnecessary step. this can be omitted if these cards never existed in the first place. moreover, it may (or may not) make the code logic for drafts simpler (such as transferring or granting ownership of cards, etc.).
But then I'm thinking, is that how it really works? Was Nightveil Specter the next card in my library all along? Or is the next card not determined until I ask to see it?
As an amateur programmer and mathemetician I'm not sure if I can explain to you how absurdly complicated that would make the shuffler. Storing the information is much easier on your computer and on the programmer. A shuffler that "actually" shuffles is much cleaner code and has fewer ways to go wrong.
[Edit] I see someone beat me to this.
Private Mod Note
():
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
This is not how they work: a slot machine is secretly pre-programmed to have the next 48 plays be losing plays and then pay a jackpot on the 49th play.
This is how they work: whether or not you win or lose depends a random number generated when you pull the lever (erm, push the button). For example, it might be the last two digits of the exact millisecond that you pull the lever, but you have no clue what that is.
My point is: slot machines have no a priori knowledge of when it is going to pay out.
That brings me to this point: any time you draw a card from your deck, does MTGO know ahead of time what card you're going to draw? Or does it depend on the exact millisecond that you draw the card? The reason I ask this is because whenever you search your library for a card, you see all the cards in your library in a neat order rather than some random order that implies the order of your deck.
(People always complain about the "shuffler". But is that a metaphor for always having unlucky random numbers that determine your draw step?)
Here's my situation. I recently played in a game where I was pretty far behind; I had one draw step left before my opponent kills me. Since I control Thassa, God of the Sea I get to scry before I draw my last card of the game. If this draw doesn't help me win, I lose the game.
I scry and it's Master of Waves. I already control one Master of Waves and a bunch of tokens so this second one will give an additional boost to the ones that are eligible to attack this turn. But he's also got plenty of blockers, so I need to make sure I have enough mana to make enough things unblockable.
I do the math, I have exactly enough mana to do everything I want, so I keep the Master of Waves on top and draw it. As soon as I draw it, it dawns on me that I actually didn't have enough mana; I'm going to lose the game now.
I concede the game and then hit the "draw next card" button after the game is over. It's a Nightveil Specter that's largely irrelevant to the math on board. In fact, my only outs were an overloaded Cylonic Rift or Curse of the Swine to remove the Thassa on the other side.
Since the next card was Nightveil Specter, I can take solace in the fact that at least my mistake in counting didn't cost me the game. Even had I scryed the second Master of Waves to the bottom, I would've drawn this useless Nightveil Specter instead.
But then I'm thinking, is that how it really works? Was Nightveil Specter the next card in my library all along? Or is the next card not determined until I ask to see it?
Isn't that how contents of booster packs are determined? The game doesn't know what's inside the pack until you ask to open it. I think that is the way that works because of something to do with preserving the print run in limited tournaments.
http://magic.tcgplayer.com/db/article.asp?ID=6995
MTGO boosters simulating real printrun sequences too.
Seriously? When did I ever even imply boosters are random? I thought that such a thing as a print run existing is pretty much common knowledge these days.
I'm talking about where you are in the print run when you open the booster pack.
If you have a physical pack, then the cards in there are not going to change: you don't know what they are but the contents don't change based on which millisecond you open it (or some other pre-determined measure).
However, isn't it the case that the contents of a pack on MTGO does depend on the millisecond that you open it?
For example, say I own 12 packs in my collection and then I traded 5. How does the machine know which 5 to give away and which 7 to keep? Isn't the answer that it doesn't matter since there's nothing inside the packs until after you open them anyway?
When you are allowed to view your entire library, the program understands that you are likely looking for specific information (say, you landed Kor Cartographers and can get a Plains out), so it sets out those specific cards in an easy to grab format, but shows you everything else as well (since you are entitled to see the entire contents of your library on any search). I can't say whether that portion of the library view is the same random order as the shuffle effect placed your deck or not.
TL;DR: It's safe to assume that Nightveil Specter was always the next card in your library. No Schrodenger's Card here.
Obviously, known parts of the deck will always remain known and the probability of each card pull is adjusted for that.
Suppose that I had 48 cards remaining in my library. My deck contains 4 Master of Waves, but I already have one in play. Then I scry and see another Master of Waves.
If I made the correct play and move that to the bottom of the deck, then would it be that hard to program the game to understand that now the next card pull has a 2/47 chance (instead of a 3/48 chance) of being yet another Master of Waves?
To me, it wouldn't be that hard for the computer to hold these two pieces of information handy:
I'm no computer expert, but it seems plausible, no?
Wow, I can't believe that never occured to me before.
Ha. Nice.
When you search your library, it is probably just providing you a conveniently sorted view (since it is about to reshuffle the library anyway).
This approach is hinted to in an early post about the MTGO shuffler from Chris Green of Leaping Lizard Software (the original MTGO developers):
Certainly, you're allowed to see the contents of your deck when you search but there's no real guarantee that you're allowed to see the contents in order. Nonetheless, this is largely irrelevant because you should know the contents of your own deck anyway (or write them down). I guess this is just one of the many ways where MTGO is different than real Magic.
The thing about the boosters is right though, right? The boosters don't actually contain any cards but rather serve as an IOU for 15 cards when you choose to claim those cards (i.e., open the pack)? When you open a pack, you're really trading in this IOU note and getting 15 cards in exchange rather than actually revealing any contents?
I'm familiar with how probability works.
If the purpose of the game was to practice to become a better player, then the mistake is equally bad, regardless of whether it ended up making a difference. If the purpose was the endgame of all preparation (that is, if this was the major event that I was preparing for), then it's worth noting exactly how much that single mistake cost.
If a football player (say, cornerback) blows his coverage assignment during a preseason game and then wide open receiver happens to drop the pass, the fact of the matter is that the corner needs get better at his coverage because the next time, the receiver might not drop it. If this same football player makes a mistake on his assignment during the fourth quarter of the Super Bowl (in the final year of his career), then it's pretty relevant whether the receiver makes the catch or not.
You say we're evaluating my choice, but we're not. I already know I made the wrong choice. That's not up for debate, I already know I was wrong: it's why I conceded; that's why I made this post!
I had four outs in my deck with approximately 48 cards remaining. I just wanted to know how much my wrong choice cost me: if my mistake cost me the 0% of the grand prize at the end (since I was going to draw the Nightveil Specter anyway), or 44/48 of the grand prize (since those are my odds that I draw a dead card).
But actually, none of the above is the real reason for this post.
The real reason for this post was to see if anyone had insight on whether the game knows the order of my library at all times, or if it does this "Schrodenger's [sic] Card" that CommiePuddin mentioned.
It comes from a genuine curiosity of how the game is coded/written; perhaps I should've asked the question without the backstory.
To random draw all the time you have to:
-Have a special-case list for whenever someone manipulates the library on top
-on bottom
-three from the top
-etc..
To do that, you'd be creating an ordered list. In fact, there are many cards in the game that result in a combo that orders your *entire library.*
From a programmer's point of view then, there's absolutely no reason to randomize the draw *ever*, because it costs extra work for the same probability of outcomes.
Thus, no reason to play with it. As someone who programs frequently (it's my job..) wasting time on useless code that saves you no code and gains you no real benefit is completely illogical; and we're basically just arbiters of logic that use machines to do it.
Look, Fetch, Draw, Look
Draw
Fetch
Look
Pretty much this. If magic didn't have ways to predetermine parts of your library (Scry, Unexpectedly Absent, Cascade) you could make it so that when you draw the game randomly gives you a card. With the library interaction it becomes far more complex to build those exception cases when you could just generate the deck once whenever it is shuffled.
Creating a program to shuffle a deck and keep it in order is rather easy. Any experienced programmer could do it in under an hour. If you give it the other special cases it basically triples the work and uses more memory overhead for no reason.
I found this from an Ask Wizards article.
I always suspected this was the case since you could own fifteen boosters and when you traded three of them away, it doesn't ask you which three you want to trade and which twelve you want to keep.
I just figured since this is how booster packs work, this might be how other unknowns (order of deck) were handled.
as said above, a known deck is much easier to handle (for both the human and computer) if you keep the cards in a known, consistent order i.e. not randomized for each draw. this way, you can sort it any way you want without messing with the original order. make a copy of the deck, sort it, and show it to the player. this is just a copy, it doesn't affect the original order. repeatedly, unnecessarily shuffling or randomizing is a waste of time and resources.
OTOH, a fresh pack isn't a known set, and so there is little reason to make the contents known before it's opened. a major reason is to save memory and disk space. i imagine that data for a single (unopened) pack would take a lot less space than 15 cards (even more for tournament decks and intro decks). not only that, cards require more information (e.g. which set, foil or not, etc.) another reason may be other types of flags or settings, like ownership. i.e. who owns the unknown cards? when you open your collection, the program would have to hide these unopened cards, which is yet another unnecessary step. this can be omitted if these cards never existed in the first place. moreover, it may (or may not) make the code logic for drafts simpler (such as transferring or granting ownership of cards, etc.).
........................
As an amateur programmer and mathemetician I'm not sure if I can explain to you how absurdly complicated that would make the shuffler. Storing the information is much easier on your computer and on the programmer. A shuffler that "actually" shuffles is much cleaner code and has fewer ways to go wrong.
[Edit] I see someone beat me to this.