
Magic: The Gathering Is Turing Complete (2012) - reimertz
http://www.toothycat.net/~hologram/Turing/index.html
======
mabbo
There lots of maybe-valid criticisms about this setup- oh, you have to use so
many game mechanics to make this work; you need to have 4 players all working
together to do it and get just the right conditions; this can never happen in
real play.

You miss this point.

Once, as an undergrad, I had just learned about the O(n) selection algorithm
(you can get the kth largest element in an unsorted list in linear time for
any value of k, which is awesome)[0], and mentioned it to a grad student
friend, but said "It's O(n), but the constant in the front is enormous, so
it's usually totally impractical". The reply has stuck with me ever since: "I
doesn't matter if this particular algorithm has a big constant. What matters
is that this algorithm proves it is even _possible_ to accomplish this task in
linear time. It might not have been."

Similarly, this Magic: The Gathering Turing Complete proof is contrived,
silly, impractical, and you are welcome to scoff at it all you want. The point
wasn't to make something practical, it was to prove _it can be done_. Now all
that's left is finding a practical way to do it too.

[0][https://en.wikipedia.org/wiki/Median_of_medians](https://en.wikipedia.org/wiki/Median_of_medians)

~~~
zitterbewegung
There are two types of algorithms . Ones we can implement with reasonable
time. Then the others where we can’t implement in a reasonable time at this
moment.

~~~
opportune
Have you ever heard of an omega or theta bound?

~~~
alexanderstears
I might have - give me a minute to check the owner's manual for my
hypercomputer.

------
sethev
So mtgox could have been implemented in Magic: The Gathering.

~~~
paulmd
Surely it would have been implemented in Magic: The Gathering Online? ;)

(MTGox was a trading site for _virtual_ trading cards, not real ones. It was
"MTG Online: Exchange", not "MTG: Online Exchange"...)

~~~
ggggtez
Incorrect. MTGO is not a true turing machine because it doesn't have infinite
tape.

>The model of the tape is as follows. A series of Zombie tokens controlled by
Alex represent the tape to the right of the current head

However, it seems that there is a limit to the number of creature tokens in
MTGO which does not exist in the paper game.

~~~
Smaug123
For that matter, a physical digital computer has a bounded number of states it
can be in, so it can't be Turing complete at all, if you're going to be really
pedantic.

You're only allowed to say MTGO is not Turing complete if you also agree that
Java is not Turing complete (because the 32-bit JVM has bounded memory it can
access).

~~~
ubernostrum
There's also the infamous video of (well-known professional player) Luis
Scott-Vargas "breaking" MTGO by causing the game to wind up in a non-
terminating loop of mandatory actions:

[https://www.youtube.com/watch?v=AGXG5rNe_tI](https://www.youtube.com/watch?v=AGXG5rNe_tI)

For those who are confused, the card involved there is Oblivion Ring:

[http://gatherer.wizards.com/Pages/Card/Details.aspx?multiver...](http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=397760)

Its effect is that, when it comes into play, you choose a non-land card in
play that gets exiled (removed from play) for as long as Oblivion Ring stays
in play, then gets returned once Oblivion Ring leaves play. This game devolves
into a situation where there are three Oblivion Rings and no other non-land
cards, so: Ring 1 exiles Ring 2, which returns Ring 3, which exiles Ring 1,
which returns Ring 2, which exiles Ring 3, which returns Ring 1, which exiles
Ring 2, and so on to infinity. The rules state that when a loop like this
occurs (which is not often in real play), the game is an automatic draw.

------
Rickasaurus
This idea inspired the 2011 ICFP programming contest, lambda the gathering:
[http://icfpc2011.blogspot.jp/2011/06/task-description-
contes...](http://icfpc2011.blogspot.jp/2011/06/task-description-contest-
starts-now.html)

------
_Codemonkeyism
OT: I have a MTG deck from somewhere between Arabian Nights and before
Legends. From those here that still play MTG, are cards still anything worth?

[Edit] Thanks a lot to everyone who answered!

~~~
rsync
Yes - old, rare cards (especially powerful ones that are now considered
"broken") have only risen in value.

They're also quite provocative. Once every few years I'll break out my very,
very old "power nine" deck and play with it at the local game store. All games
stop. Everyone comes to look. People take pictures.

~~~
mirceal
I hope you play without sleeves and watch the other players shrivel... From
time to time you should mumble: yes peasants! I'm that rich :)
ahashahahahahahahzha

~~~
rsync
Sleeves, definitely.

The cards were not that expensive when I bought them in 1994/1995 ...

------
cantrip
Previous discussion:

[https://news.ycombinator.com/from?site=toothycat.net](https://news.ycombinator.com/from?site=toothycat.net)

------
maxiepoo
As someone that does not understand the rules of Magic, how do they get around
the fact that a Turing machine requires infinite memory? Presumably a
particular game of Magic has a finite set of cards and probably states too?

~~~
xaedes
huh? - so we can never build turing machines? because we can never build
infinite memory?

~~~
gnulinux
Yes, computers are not Turing machines but finite state machines. But in
practice, this is not very useful since the number of states of a computer is
huge, so, Turing machine is a good model for computers. In math, we're not
interested in physical objects but models and it turns out the study of Turing
machines can be applied to physical computers. When you think of computer, you
do not think it as finite state machine, but as a Turing machine. Maybe if you
had a machine with 1KB memory, you could think it as a finite state machine,
if it's more useful.

Another thing is, most algorithms people deal with are O(1) since people are
interested in ints which can represent -2^63 to 2^63-1. But this is just an
abuse of terminology, an algorithm that tries all 2^64 combinations would be a
very impractical O(1) algorithm. So, we instead use a different model, and
pretend integers are arbitrarily long and their length is O(logn) bits. This
is now a better model for physical computers.

------
pimmen
Absolutely awesome. I could probably talk for hours with this guy!

------
gt_
I quit playing Magic in 1999 when my 4 friends and I found out we were playing
by the wrong rules.

We went into town, to a tournament at a comic shop, and saw the games taking
20 minutes. Ours took 1-2 days.

We tried what was, to us, the “new rules” and we were disappointed, gave up.
It was a big blow. Suddenly the cards were less enchanted, the decks were less
sacred. Maybe if I had understood the Turing completeness of Magic, I would
have had it in me to start a tournament under our rules. Well, I still could
if I had written them down. I’m pretty sure they were the best rules.

~~~
PhasmaFelis
> _Ours took 1-2 days._

...What were you doing?

~~~
gt_
I don't remember the exact difference but it was only a small change from the
normal rules that had an exponential impact.

~~~
harpiaharpyja
That's really curious, too bad you forgot.

~~~
gt_
If I were to re-learn the rules, I could probably point it out. The best I
recall is we were skipping a small step in the turn cycle.

~~~
PascLeRasc
Maybe it was upkeep-related? There's the phrase "untap, upkeep, draw" and all
the "at the beginning of your next turn" cards refer to the upkeep phase if
I'm not mistaken, maybe putting upkeep before untap or after draw would lead
to some weird long-term mechanics.

------
jeremy7600
Shouldn't this be (2012)?

~~~
sctb
Since we're not reading it in Japanese, yes. Thanks!

------
rulusidaze
A pencil and paper is Turing Complete. A bunch of rocks in a grid is Turing
Complete.[1]

Sorry to be an ass but I can't even guess how many "X is Turing Complete"
things I've seen over the years. Turing's point wasn't to define what _can be_
a computer, it was to define the limits of computation itself. Which is a far
more interesting topic, hence my irritation with this post.

[1][https://xkcd.com/505/](https://xkcd.com/505/)

~~~
ajkjk
No, the interesting point is that the rules of MtG are Turing Complete, not
that you can express something that's Turing Complete using them as your
notation. That wouldn't be interesting at all.

~~~
rulusidaze
>rules of MtG are Turing Complete

Yes, but only if you are:

>using them as your notation

From the linked article:

>The machine below just extends this idea

The author admits he has constructed an artificial scenario under which a
Turing Machine is generated. This is exactly the same as using the rules of
MtG as a notation to create a machine.

A generalized set of the rules for the game Go is Turing Complete. A
generalized set of the rules for the game Go Fish is Turing Complete.

~~~
TheRealPomax
Okay, so all you've said is "Go is, interestingly, also Turing Complete". That
is interesting and worth-posting-about information. In an attempt to
illustrate the futility of the Mtg example with a Go example, you have in fact
merely illustrated that in addition to Mtg, Go is ALSO interesting to look at.

Mtg can be shown to be Turing Complete in one (of quite a few, actually)
subset of rules. That's cool, and unexpected to many, and worth reading about.

And that's true for any other example of things not usually associated with
programming.

(Turing completeness is an algorithmic property, not a "thing" property, so a
pencil and some paper, or a bunch rocks, are certainly not Turing complete:
you need procedural rules as well, something Mtg has no shortage of)

~~~
rulusidaze
I know I shouldn't bite, but I just want to so bad...

>so all you've said is

Actually what I said was "a generalized set of the rules" for Go is Turing
Complete. Go in itself is not, because the end-state of the game is
indeterminate. Just as a "regular-ass" game of MtG without a very specific and
artificial construction is not Turing Complete, in and of itself.

>That's cool

I can appreciate stamp collecting, and I don't want to say that it's an
invalid use of time. There are plenty of worse hobbies. But my point is that
any of an infinite, arbitrary, and inconsequential number of conceivable
systems are "Turing Complete," and personally I don't find this very
compelling.

How many books in the Library of Babel[1] describe a Turing Complete system?

>Turing completeness is/is not

I stated as much in a comment below, or you could have inferred the same by my
interpretation of the XKCD comic, but thanks for assuming I'm incompetent and
acting in bad faith.

[1][https://en.wikipedia.org/wiki/The_Library_of_Babel](https://en.wikipedia.org/wiki/The_Library_of_Babel)

~~~
lmkg
Are you making the distinction that most MtG _decks_ are not Turing-Complete?
Is that what you mean by "specific and artificial construction?"

I think most people assumed that Turing-Completeness requires a specific and
artificial construction, which is where the disconnected (and downvotes) are
coming from. Especially for something wasn't previously believed to be a model
of computation at all, much less a Turing-Complete one.

------
_Codemonkeyism
No it isn't.

With some contrieved meaning of the cards, which has nothing to do with the
"meaning of the card" in Magic the game, like "State B, Colour 16: Stay in
state B, colour this space 18, move one step right." it recreates a
complicated and arcane turing machine.

~~~
tdb7893
Isn't what states "mean" irrelevant to whether it's a Turing machine? I was
under the impression that as long as it can simulate a Turing machine (even an
arcane or complicated one) is Turing complete and the state could be stored in
anything (it's not like electricity has some special property that makes it
better for Turing machines)

~~~
pbhjpbhj
>it's not like electricity has some special property that makes it better for
Turing machines

Transmission, storage with magnetic interactions of electrical actions, small
size of components, speed of transmission -- aren't these properties that make
for more practical Turing machines?

Parked cars are going to take ages to do anything useful with, no.

(IANAComputerScientist)

~~~
dsp1234
This is just a miscommunication of what "better" means in this context.

No one disputes that a modern computer implementing a Turing machine is going
to calculate faster than manually manipulating MTG cards.

However, better here means 'more expressive'. Turing completeness is concerned
with whether or not a computational system is 'universal' or not. In other
words, whether that computational system can compute everything that another
computational system could. If two systems can both be shown to simulate a
Turing machine, then that means that those systems could compute the same
exact set of things (given enough time).

So with regards to expressiveness (or the things a system could theoretically
compute), since a modern computer can implement a Turing machine and a MTG
game can implement a Turing machine, they are both the same, and thus neither
is 'better'. In other words, the addition of electricity doesn't effect what a
system could theoretically compute.

------
AgentEpsilon
No it isn't.

I can forgive the extremely contrived decks, but using a card to completely
change the behavior of the majority of your cards doesn't mean the game itself
is Turing complete. If anything, this is just showing how you can utilize
Magic _game mechanics_ to create a Turing Machine.

~~~
rhaps0dy
>the game itself is Turing complete [...] you can utilize Magic game mechanics
to create a Turing Machine

Aren't those two statements equivalent?

