In

another thread, some people were discussing a theoretical way to define an engine by imagining an infinitely large deck. Equivalently, we could imagine a deck where we draw cards

*with replacement*--meaning that every time we draw a card, we shuffle a copy of that card into our deck.

I am a condensed matter physicist. This problem interested me because the transition between big money and an engine is similar to physical phase transitions, such as that between water and ice.

I'd be interested in writing an article that is accessible to a broad audience, but this is not that article. First I need to figure out what's going on. And I know there's a lot of math expertise around f.ds, so maybe you can help.

**The Laboratory engine**Suppose we have a deck with just Coppers and Laboratories. Let's say the fraction of labs is D (for "draw") and the fraction of coppers is 1-D. It's fairly easy to figure out the expected value of a turn.

Let x be the average value of a card. The average value of a turn is simply 5*x.

x = 1-D + D*2*x

x = 1+D/(1-2D)

I drew this with a mouse so it's not to scale.

As you can see, the average value of a turn diverges as D approaches 1/2. That's the phase transition. When D is greater than 1/2, your deck has a nonzero probability of drawing forever. Let's use "reliability" to refer to the probability that you draw forever. I don't have an explicit expression for the reliability, but I know that the larger D is, the larger the reliability is.

When D is at the critical value of 1/2, this is a special case. The reliability is zero, but the average value of a turn still diverges as you increase the size of your deck.

mad4math proved that the average value of a turn is grows as sqrt(N), where N is the size of your deck.

When D is somewhat below 1/2, we might say that this is "practically an engine". In practice we only need to draw finite decks, and we even get to draw 5 cards for free at the start of turn. So yeah, depending on the size of your deck, the phase transition actually occurs earlier than these calculations suggest.

**The Village/Smithy engine**Next we consider a more complicated case, a Village/Smithy engine. Let's say that the fraction of villages is A (for "action") and the fraction of smithies is D (for "draw"), and the fraction of coppers is 1-A-D. I don't know the best way to calculate the average value of a hand, but here I give it my best shot.

Let x be the average value of a card, not including dead draw.

x = 1-A-D + Ax + min(A,D)*3*x

x = (1-A-D)/(1-A-3*min(A,D))

The engine phase transition occurs when the denominator is zero.

I am not sure how to add the value of dead draw, but it should be p*3*(1-A-D), where p is the probability of having at least one extra smithy in hand, with only one action remaining and no villages. I believe this is most important when D > A and (1-A-D) is large. Anyway, here's the phase diagram:

It's triangle-shaped because we have the inequality A+D < 1. I didn't have the space to draw it, but there should still be a "practically an engine" region.

I was also thinking there might be a more elegant choice of variables. Let V be the number of villages per copper, and S be the number of smithies per copper. In this case, x = 1/(1+S-3min(S,V)). I'm not sure if this is more or less intuitive, but here's the phase diagram:

Hmm... I wonder if you could get rid of the "practically an engine" region if you just define V and S to be the number of villages/smithies per copper past the first five coppers.

**Questions**-I know the calculations aren't perfect, so can you think of any better way?

-How can I estimate the value of terminal draw?

-Is there any way to estimate reliability?

-If I wanted to make this broadly accessible, which parts are particularly confusing or need explanation?

-Any other thoughts?