# Dominion Strategy Forum

• February 09, 2023, 05:02:06 am
• Welcome, Guest

### News:

DominionStrategy Wiki

Pages: [1] 2  All

### AuthorTopic: Choosing the correct number of terminal actions  (Read 16086 times)

0 Members and 1 Guest are viewing this topic.

• Margrave
• Offline
• Posts: 2830
• You make your own shuffle luck
• Respect: +3878
##### Choosing the correct number of terminal actions
« on: August 31, 2011, 03:56:25 pm »
+3

To preface: I am a nerd. I apologize if my description of this is too nerdy (math-heavy/theoretical) for you. I am also a n00b. I apologize if I am missing some obvious thing that makes this whole argument pointless.

Inspiration: I've recently come to realize that many times (in the base game), I tend to buy too many terminal actions, so I'll draw two in my hand and I'm only able to play one.

Looking over the BM/Smithy strategy, it seems that for the length of game expected by that strategy -- where your deck grows to a size of 25-30 cards -- the correct number of terminal actions to buy is one. However, if I'm using lots of +Buy (maybe playing a Gardens game), my deck could grow larger, maybe to 50 cards. It would seem that having a second terminal action has a net benefit to my deck in this case. If I had 100 cards in my deck, two terminal actions would probably not be enough...

Does this only apply to the base game? Quite possibly. However, I think that a solid understanding of this concept would be helpful to decreasing the number of times I have a dead card in my hand, which would be a very good thing.

This gets complicated: As I thought more about this, I realized that in order to apply this to a variety of game situations, the analysis has to get a little more complicated -- something that gets more difficult to do in your head as you're playing -- something that relies on keeping track of several variables as the game progresses, such as how many cards are in your deck, how many and what kinds of terminal actions you've already bought, etc.

I think what I want to do is to start with simple situations, then add in more complicated stuff and see if I can still keep the complexity down to the back-of-the-envelope level. Even if I can't, at least I'll end up with a better theoretical understanding of how this concept works.

What stays the same, regardless of the kingdom cards: It seems that the issue at the heart of this is the following question -- How do I balance the risk of having my terminal actions collide (buying too many actions) against the wasted opportunity of not drawing my action cards on my turn (buying too few actions)? In other words, where is that "sweet spot"?

Obviously, the answer to this question is "it depends on your terminal action". Surely there are terminal actions that are so good that you can justify having two or three of them in a 20-card deck, just to make sure you can draw them more often (maybe Witch is a good example of this?); while there are other actions, where it's not a big deal if you can't play it every turn (Woodcutter, maybe? Remodel?); and probably everywhere in between.

I'm not asking to create a strict ranking of every terminal action card in this sense. What I think would be better is to have a rough idea of which cards you only want one of, and which cards are worth pushing the chance of a collision just to have multiple copies.

Also, I think a good metric to define here is %collision. It measures the likelihood that as I draw 5-card hands from a given deck, that I'll end up with at least one action card that I can't play (because it was in the same hand as another action card) before I have to re-shuffle.

Why %collision? There are other metrics I could have used here, but I think this metric is useful because once you know it, you can more clearly evaluate buying another terminal action card. If my %collision goes from 10% to 50% when I add this card to my deck, is it really worth it to only get 60% of the benefit out of this card? (in other words, I won't get to play my card 40% of the time, so I can think of it as having only 60% of its value)

Using this %collision metric, I'd like to break up this analysis into two parts: 1: computing %collision for a given deck, and 2: determining the appropriate %collision for each terminal action card.

1: Computing %collision: I'll start off by saying that I believe it's not possible to exactly compute %collision for a given deck. Shuffling mechanics would be difficult to simulate (though I think it's been done before on here), but to simulate it perfectly, there would need to be a way to determine what the "best" action card would be to play in any given situation, and I believe that depends on too many outside factors. I think simulations could make computing %collision a lot quicker in many cases, but since it would most often just be an approximation anyways, I'd like to make the goal of this section to compute a "reasonable" approximation for %collision using the simplest method possible.

The simplest case: 0 or 1 terminal actions in a deck of n cards. %collision is 0% here.

A little more complicated: 2 terminal actions in a deck of n cards. Consider the hand where you draw one action card, you have four other cards in that hand; if the other action card is one of those four, collision. If not, then no collision. %collision ~= 4/(n-1).

Wait a minute -- what if my terminal action card is Smithy (or Witch, or even Council Room)? There's a chance that as I draw more cards from my deck, I'll draw my second action dead! This isn't taken into account here, and it significantly increases your %collision!

Witch (+2 cards): %collision = 6/(n-1)
Smithy (+3 cards): %collision = 7/(n-1)
Council Room (+4 cards): %collision = 8/(n-1)

Deck     - +0,     +2,    +3,   +4
12 cards - 36%, 55%, 64%, 72%
15 cards - 28%, 43%, 50%, 57%
20 cards - 21%, 32%, 37%, 42%
25 cards - 17%, 25%, 29%, 33%
30 cards - 14%, 21%, 24%, 28%
40 cards - 10%, 15%, 18%, 21%
50 cards -   8%, 12%, 14%, 16%

Ouch. An interesting aside, though -- if I attempted to factor in the opportunity cost of buying a Silver instead of a Smithy in BM/Smithy, I would imagine that the average treasure value of the three extra cards you draw (multiplied by (1 - %collision)), compared to a Silver would probably require a very low %collision to make it worthwhile. This sort of goes into the next part of the analysis, though, where we determine the appropriate value of %collision for that particular situation.

The third terminal action: Calculations can get a little messy here without making some simplifying assumptions that will introduce a small amount of error, mainly that we will ignore the possibility of a collision of all three terminal action cards since it's unlikely, and it makes our estimates more conservative.

You can take the %collision you get from the two-terminal-actions formula and multiply it by 2.5 to get your new one, but the interesting metric here is just the difference between your old %collision and your new one, which will 1.5 times the %collision for going from one to two.

Adding in non-terminal actions: If we add in cards that give you +2 actions, you get into the theory of building more complex engines. Even the simplest case I can think of, Village/Smithy, involves calculations that are more complex than back-of-the-envelope calculations, and I also think that the %collision metric isn't as useful in that case.

I will assume that all non-terminal actions here are +1 action. In this case, the analysis is easy when you have +1 action, +0 cards, (even though I don't know of any +1 action, +0 cards actions in the base game) since that card will act exactly like a treasure card (as long as we don't draw it dead with our terminal action).

Speaking of that, I don't think it's a good idea to stick a Smithy in a Lab deck because of the danger of drawing Labs dead. I would think that a terminal action in a deck like this would more likely be an attack that gives you some coins, rather than a way to draw more cards, since that's what your non-terminal actions are for. Wouldn't you just use Library instead here? Please correct me if I'm wrong, though.

Anyways, if you have a non-terminal action like +1 action, +c cards, I think the easiest approximation to remember is to keep track of how much "extra drawing power" your deck has (which is just the sum of all the +c on these cards, I'll call it capital C), to get an idea for "average cards per hand" for your deck (for the curious, A = 5n/(n-C) where n is the total number of cards in your deck). We could replace the "4" in the two-terminal-actions formula with A and get the following terrible formula:

%collision = (5C + 4n)/(n(n-1))

If we make another simplifying approximation, we can take that two-terminal-actions formula and just replace (n-1) with (n-C) and still get a reasonably accurate formula for %collision:

%collision = 4/(n-C)

Intuitively it kind of makes sense to just modify the deck size here, and even though I have no mathematical justification for it, I plugged in a bunch of values into Excel and there's less than 2% error for values of C small enough where you would actually consider buying a second terminal action as part of your engine. Higher than that, and you would just continue to buy non-terminal actions.

The real usefulness of this formula comes when your deck gets to exceed 25 cards, and you have a few non-terminal actions in your deck; you can see how a C of 5 will add about 10% to your %collision here.

2: Determining the appropriate %collision for each terminal action card: This is where I'm not so helpful, because of my lack of experience. I know there are several terminal actions that you would never want more than one of, and they probably don't apply to this analysis. However, just thinking of the base set, I can think of lots of different terminal actions that might have different %collision values that make them worth it...

The "real" question: later in the game, when your deck has reached a large enough size to justify buying that second (or maybe third) terminal action card according to whatever numbers we come up with, is there any situation where you shouldn't just buy a green card instead? Maybe it's not useful in practice to compute %collision on the fly; but I think it would help me, a n00b, to understand what a deck "feels like" that has the appropriate number of terminal actions in it. Also, this could be another useful metric for comparing terminal action cards, at least in the absence of any +2 Actions cards.

Here's a list of all of the terminal action cards in the base set that seem to make use of the %collision metric. They will be accompanied by any simulation results I've done, simulations I plan to run, or questions/issues I have with simulation.

Adventurer - there is some protection here against action collision that sort of breaks the %collision math.

Chancellor - Probably only want one in your deck, and it probably messes with the %collision math too.

Chapel - Probably only want one in your deck, and since deck size isn't non-decreasing when you use this card, the %collision math doesn't quite benefit us here.

Library - there is some protection here against action collision that sort of breaks the %collision math.

Mine - Probably only want one in your deck.

Moneylender - Probably only want one in your deck.

Remodel - Probably only want one in your deck, and if you want more than one, collision isn't necessarily a bad thing.

Woodcutter - After running simulations, no benefit was seen in any circumstance I could come up with to buying a second Woodcutter -- %collision = 0%

Bureaucrat - After running simulations, no benefit was seen in any circumstance I could come up with to buying a second Burearcrat -- %collision = 0%

Smithy
Optimized: deck size = 22 (second Smithy)
%collision = 33.3%
deck size = 20 (third Smithy)
%collision <= 40%
Condition - 3-player game, one opponent spamming Militias

Council Room
Optimized: deck size = 23 (second CR)
%collision = 36.4%
Maximum:   strategy: buy three Council Rooms ASAP. %collision doesn't seem to enter in here, it's tough to discern an optimal value here with these results, since the action costs \$5 and the optimal play is just to buy it over silver.
%collision >= 45%
Condition - 3-player game, one opponent spamming Militias

Militia
Scenarios to test:
vs. BMU
opponent using    Militia
opponent spamming Militia
opponent using    Library
opponent spamming Library
opponent using    Moat
opponent spamming Moat
Stress Test: vs. Village/Smithy engine?

Thief
Scenarios to test:
vs. BMU
opponent using    Thief
opponent spamming Thief
opponent using    Moat
opponent spamming Moat
Stress Test: vs. Chapel/BMU in a 4-player game?

Witch
Scenarios to test:
vs. BMU
opponent using    Witch
opponent spamming Witch
opponent using    Moat
opponent spamming Moat
opponent using    Chapel

Moat
Scenarios to test:
vs. BMU
opponent using    Bureaucrat
opponent spamming Bureaucrat
opponent using    Militia
opponent spamming Militia
opponent using    Spy
opponent spamming Spy
opponent using    Thief
opponent spamming Thief
opponent using    Witch
opponent spamming Witch
Stress Test: probably already covered, maybe a combinations of these in a 4-player game?

Workshop -- There has to be a better strategy for this card other than BMU + Workshop, right?

What are the correct questions to ask here? Perhaps there is a situation where no matter how large your deck is, you would never want anything more than your one terminal action. Perhaps there is a situation where, no matter how many collisions you risk, you want to buy as many terminal actions as you can just so you can have the highest chance of playing one every turn. I'm sure there's also every situation in between as well. I imagine like a histogram that makes a bell curve. Most terminal actions will be worth buying at a %collision in a certain range, with the better ones being higher.

The results I've gotten so far suggest two interesting %collision values:

1. The "vanilla" BMU + Terminal Action deck %collision (I'll call it the "optimized" %collision) - Based on simulation results, if your deck is large enough so that your %collision differential is less than this value, you should buy your next terminal action the next chance you get. Unless otherwise noted, the priority for this falls after buying a Gold, but before buying a Silver.

2. The highest possible %collision that could benefit you (I'll call it the "maximum" %collision) - I tried to set up a sort of "stress test" to find the highest optimal value for %collision under any circumstance. If your deck is small enough that your %collision exceeds this value, you should definitely wait to buy your next terminal action, no matter how bad you think it is.

These two boundary values of %collision give you three ranges: the "definitely buy" range, the "definitely don't buy" range, and the "use your judgement" range. The assumption here is that anything that will make you want to buy less terminal actions will either change your %collision, or be "it's time to buy victory point cards now". Nothing else is taken into account, so if there's anything I'm missing, please tell me.
« Last Edit: September 29, 2011, 12:26:42 pm by AdamH »
Logged
Visit my blog for links to a whole bunch of Dominion content I've made.

#### Mean Mr Mustard

• Witch
• Offline
• Posts: 452
• First to 5000 Isotropic wins
• Respect: +118
##### Re: Choosing the correct number of terminal actions
« Reply #1 on: September 01, 2011, 06:14:23 am »
0

Okay, look.  At the risk of sounding like someone who doesn't bother understanding the math behind Dominion, I think you are way over-thinking this.  It is enough to understand that drawing actions dead is a potential danger and taking steps to avoid it.

For example, if I am using a hard draw card unsupported (like Council Room) then treasure cards are indeed stronger on average than actions.  So therefore, I will only take this route if there are not good non-terminals to build an engine with.  If there are strong Village-types and good trashing available, this all can change and the strong drawers become a decent engine and the balance of non-terminals is completely different.  If there are a good spread of useful non-terminals perhaps the best solution is a lot of them with a single strong terminal attack.  I guess what I am trying to say is that every Kingdom is virtually unique and there are no hard and fast rules, mathematical or otherwise, that can apply to even a slim majority of them.

Or we can throw all that out of the window and simply say in a Kingdom with zero synergy or trashing the correct number of non-drawing terminals is <b>two</b> or the correct number of hard drawing terminals is <b>one</b>.  The rest of your buys should be treasure.

But do not be surprised when, having come up with a formula that seems to mathematically answer for you the exact composition of a winning Dominion deck, you still get thoroughly trounced by a more experienced player.  I suggest you focus rather on learning how the cards interact, learning the PPR and trying to learn when to avoid or force a reshuffle.

Logged
Jake <a href=http://dominion.isotropic.org/gamelog/201203/17/game-20120317-030206-6456f97c.html>opening: opening: Silver / Jack of All Trades</a>
<b>IsoDom1 Winner:  shark_bait
IsoDom2 Winner: Rabid
Isodom3 Winner: Fabian</b>
Utúlie'n aurë! Aiya Eldalie ar Atanatári, Utúlie'n auré!

• Margrave
• Offline
• Posts: 2830
• You make your own shuffle luck
• Respect: +3878
##### Re: Choosing the correct number of terminal actions
« Reply #2 on: September 01, 2011, 07:52:45 am »
0

Well, you're probably right about all of that. Overthinking is what I do.

However, if it is the case that there are decks where the "correct" number of terminal actions is two, is there a reliable way to say when the "correct" time to buy that second terminal action is?
Logged
Visit my blog for links to a whole bunch of Dominion content I've made.

#### Mean Mr Mustard

• Witch
• Offline
• Posts: 452
• First to 5000 Isotropic wins
• Respect: +118
##### Re: Choosing the correct number of terminal actions
« Reply #3 on: September 01, 2011, 07:58:49 am »
0

After the first shuffle, usually.
Logged
Jake <a href=http://dominion.isotropic.org/gamelog/201203/17/game-20120317-030206-6456f97c.html>opening: opening: Silver / Jack of All Trades</a>
<b>IsoDom1 Winner:  shark_bait
IsoDom2 Winner: Rabid
Isodom3 Winner: Fabian</b>
Utúlie'n aurë! Aiya Eldalie ar Atanatári, Utúlie'n auré!

#### DStu

• Margrave
• Offline
• Posts: 2627
• Respect: +1490
##### Re: Choosing the correct number of terminal actions
« Reply #4 on: September 01, 2011, 08:08:40 am »
0

Okay, look.  At the risk of sounding like someone who doesn't bother understanding the math behind Dominion, I think you are way over-thinking this.  It is enough to understand that drawing actions dead is a potential danger and taking steps to avoid it.

Somehow feel the same.  I think a good question to ask is: "Given I go BigMoney+X, how many of which terminals do I want to have in my deck. And which one do I prefer to others. And of course in which situations do I go for BM+X?" This situation arises quite often, and when you go the BM-route, it is good to know how a good deck locks like. I think for this task, the simulator is probably the right tool.
Calculating the collisionprobability at a given time is a ansatz that is too static, as your deck will fill with more cards and the prob will change, mostly decrease. But when the number drops, and it is "the right time" (by any calculation) to get another terminal, maybe you have \$6 or \$8 in the hand, or the game tends to end and you like Duchies already.
And even if you wil get exact numbers, they alone are meaningless. As you mentioned, you have to weight the risk of them collidiing against the benefit of playing two. This is quite different for say Withc vs. Woodcutter. And you have to estimate this benefit anyway, so there is no reason to get exact values for the first.

For example, say you play BM+Militia, and the "right" number of Militias for this deck at the typical end of the game would be 3 by a collisioncalculation. You would prob, quickly pick up the first, but wait for the second until near endgame to avoid colllisions. Than you want the second, and near the very end you would want the third. But to achieve that, you have to pass up on a say Gold on midgame to buy a Militia, and that's not really what you want. And for the last, you will probably never have the chance, as you will prefere Estates over Militia at this time. So either you get them early, or the opportunitycost to get them might increased.
Logged

#### rinkworks

• Saboteur
• Offline
• Posts: 1316
• Respect: +936
##### Re: Choosing the correct number of terminal actions
« Reply #5 on: September 01, 2011, 08:18:59 am »
+1

Come on.  There is totally a place for math and analysis like this.  You're right that in practice, the math takes a backseat to strategy on a more intuitive level, which grows out of experience.  But studying the math enough to understand on an intuitive level how shuffle luck really works, is a brilliant and fantastic mental tool that can be employed in the practice of a winning Dominion strategy.  I imagine that it takes a certain kind of brain to benefit from such an analysis (we all have different methods of learning that work for us), but there are such people, myself being one.  Let's not be hasty to dismiss this article as overthinking.

There are also other uses for this kind of research besides someone simply learning how to play better.  I have an interest in A.I. and have been attempting to build an A.I. for Dominion, specifically one that looks at card behavior, rather than card names, so that it would be able to play somewhat reasonably even when it encounters cards from new expansions or people's custom cards for the first time.  It's a daunting and perhaps foolhardy enterprise, but I've enjoyed pursuing it.  Anyway, obviously computers have no intuition -- the math behind the game is all they've got to work with.

Anyway, thanks for this article.  That chart of percentages was the most intereting part for me (now speaking again as a player, rather than a bot designer).  It's a great little snapshot view of how the risk of collision damage changes with deck size and drawing power in a simple case.  I also appreciated the reminder that not all terminals are created equal.
Logged

#### DStu

• Margrave
• Offline
• Posts: 2627
• Respect: +1490
##### Re: Choosing the correct number of terminal actions
« Reply #6 on: September 01, 2011, 08:35:02 am »
0

Come on.  There is totally a place for math and analysis like this.  You're right that in practice, the math takes a backseat to strategy on a more intuitive level, which grows out of experience.  But studying the math enough to understand on an intuitive level how shuffle luck really works, is a brilliant and fantastic mental tool that can be employed in the practice of a winning Dominion strategy.  I imagine that it takes a certain kind of brain to benefit from such an analysis (we all have different methods of learning that work for us), but there are such people, myself being one.  Let's not be hasty to dismiss this article as overthinking.

Probably I've been to harsh. I like seeing numbers, but the article ends with asking what are the right questions to ask further. And thinking about this, there is not much that you can do with this numbers. Seeing them, or about the order they are is important, wrote this for the last post but got edited out. So it get's said here.

But somehow for all interesting questions you want to get answered for the kind of games where the collision is interesting, I end up by: "OK, I'll take the simulator and try it out."
Logged

#### DStu

• Margrave
• Offline
• Posts: 2627
• Respect: +1490
##### Re: Choosing the correct number of terminal actions
« Reply #7 on: September 01, 2011, 08:35:52 am »
0

Come on.  There is totally a place for math and analysis like this.  You're right that in practice, the math takes a backseat to strategy on a more intuitive level, which grows out of experience.  But studying the math enough to understand on an intuitive level how shuffle luck really works, is a brilliant and fantastic mental tool that can be employed in the practice of a winning Dominion strategy.  I imagine that it takes a certain kind of brain to benefit from such an analysis (we all have different methods of learning that work for us), but there are such people, myself being one.  Let's not be hasty to dismiss this article as overthinking.

Probably I've been to harsh. I like seeing numbers, but the article ends with asking what are the right questions to ask further. And thinking about this, there is not much that you can do with this numbers. Seeing them, or about the order they are is important, to see that it is not a good idea to get the second CR with your second \$5 without Villages. OK, sounds too negative, same is more realistically true of course for Smithy/Envoy. Wrote this for the last post but got edited out. So it get's said here.

But somehow for all interesting questions you want to get answered for the kind of games where the collision is interesting, I end up by: "OK, I'll take the simulator and try it out."

Edit 7: For more constructive feedback
Quote
Chancellor - Probably only want one in your deck, and it probably messes with the %collision math too.
I'm not sure that this is true. Given you want a Chancellor for its ability in the deck (so you want to force fast reshufflings), you probably don't mind more. Everything after the first Chancellor is not reached this shuffling, but given you want to have this ability, why don't you want to have the probabiliity as high as possible that you can use it fastly? The more Chancellors, the quicker you see the first one each shuffle.
Furthermore, it does not mess whith the math, as it does not draw cards. It is just that, usually, the collision probabilities are determined at the time of the reshuffling, which can be some time after you purchase a card. With a Chancellor, this reshuffling occurs more often, so the probabilites are updated more often.

Edit8:
@3-card collisions: I think this is not quite correct. You said you must roughly double the probability, which is correct if you consider: "Given the hand which draws my first terminal, what is the probabiltiy that I will collide which one of the others". Here you roughly double the probability, ignoring the collision of all three.
But that would not be the interesting part, as in each shuffle, there is not only the possibility of collision of 1/3 and 1/2, but also of 2/3 which ommited. So the probability that your third terminal will collide with one of the others itself is twice the probability that the two collide, so the increase of the collisionprobablility should be roughly twice the value in the table.
Edit9: Where we come back to the Chacellor and the messing of the math, because here you should only be worried if the first-drawn Chancellor collides with one of the others, where you should really only have an increasement that is as high as the original collision-probability.
« Last Edit: September 01, 2011, 08:53:42 am by DStu »
Logged

#### Mean Mr Mustard

• Witch
• Offline
• Posts: 452
• First to 5000 Isotropic wins
• Respect: +118
##### Re: Choosing the correct number of terminal actions
« Reply #8 on: September 01, 2011, 09:04:05 am »
0

Yes, I am more of an intuitive player and I realize that the mathematical analysis of these kinds of things can be a helpful tool, but the point remains: the best-laid plans of mice and men often go awry.  Like counting cards in Blackjack, if you play a thousand games of Dominion the statistical odds of certain things happening will surely follow the math, but unlike Blackjack you will lose more games regardless unless you have mastered other more important fundamental aspects of the game.
« Last Edit: September 01, 2011, 09:22:37 am by Mean Mr Mustard »
Logged
Jake <a href=http://dominion.isotropic.org/gamelog/201203/17/game-20120317-030206-6456f97c.html>opening: opening: Silver / Jack of All Trades</a>
<b>IsoDom1 Winner:  shark_bait
IsoDom2 Winner: Rabid
Isodom3 Winner: Fabian</b>
Utúlie'n aurë! Aiya Eldalie ar Atanatári, Utúlie'n auré!

#### WanderingWinder

• Offline
• Posts: 5275
• ...doesn't really matter to me
• Respect: +4380
##### Re: Choosing the correct number of terminal actions
« Reply #9 on: September 01, 2011, 09:46:18 am »
+1

Okay, look.  At the risk of sounding like someone who doesn't bother understanding the math behind Dominion, I think you are way over-thinking this.  It is enough to understand that drawing actions dead is a potential danger and taking steps to avoid it.

For example, if I am using a hard draw card unsupported (like Council Room) then treasure cards are indeed stronger on average than actions.  So therefore, I will only take this route if there are not good non-terminals to build an engine with.  If there are strong Village-types and good trashing available, this all can change and the strong drawers become a decent engine and the balance of non-terminals is completely different.  If there are a good spread of useful non-terminals perhaps the best solution is a lot of them with a single strong terminal attack.  I guess what I am trying to say is that every Kingdom is virtually unique and there are no hard and fast rules, mathematical or otherwise, that can apply to even a slim majority of them.

Or we can throw all that out of the window and simply say in a Kingdom with zero synergy or trashing the correct number of non-drawing terminals is <b>two</b> or the correct number of hard drawing terminals is <b>one</b>.  The rest of your buys should be treasure.

But do not be surprised when, having come up with a formula that seems to mathematically answer for you the exact composition of a winning Dominion deck, you still get thoroughly trounced by a more experienced player.  I suggest you focus rather on learning how the cards interact, learning the PPR and trying to learn when to avoid or force a reshuffle.

I respectfully disagree. You can go on intuition, but probably your intuition will lead you wrong at some point because of your natural biases. The mathematical and statistical analyses should be able to provide you with the correct gameplan for any simple strategy like this, provided you do enough math. Having said that, you have to do more math that this fellow has in order to get to that point. You need to take into account when you can buy the different cards (money, actions, victory), and buy with a view to the probabilities of what will come up in the future. In fact I have done these kind of analyses myself, ad in general I don't actually use them, because I am lazy, but when I am serious, I will sit and calculate things for quite a while when choosing my strategy.
And with most terminals, this is not enough in fact. Even with smithy, you'll usually get a second (or even a third, rarely). And with non-drawers, three is very common, and four is not ridiculous. But you also have to take into account other factors, like what your opponent buys and how that effects your deck.

#### WanderingWinder

• Offline
• Posts: 5275
• ...doesn't really matter to me
• Respect: +4380
##### Re: Choosing the correct number of terminal actions
« Reply #10 on: September 01, 2011, 09:52:48 am »
+1

Okay, look.  At the risk of sounding like someone who doesn't bother understanding the math behind Dominion, I think you are way over-thinking this.  It is enough to understand that drawing actions dead is a potential danger and taking steps to avoid it.

Somehow feel the same.  I think a good question to ask is: "Given I go BigMoney+X, how many of which terminals do I want to have in my deck. And which one do I prefer to others. And of course in which situations do I go for BM+X?" This situation arises quite often, and when you go the BM-route, it is good to know how a good deck locks like. I think for this task, the simulator is probably the right tool.
Calculating the collisionprobability at a given time is a ansatz that is too static, as your deck will fill with more cards and the prob will change, mostly decrease. But when the number drops, and it is "the right time" (by any calculation) to get another terminal, maybe you have \$6 or \$8 in the hand, or the game tends to end and you like Duchies already.
And even if you wil get exact numbers, they alone are meaningless. As you mentioned, you have to weight the risk of them collidiing against the benefit of playing two. This is quite different for say Withc vs. Woodcutter. And you have to estimate this benefit anyway, so there is no reason to get exact values for the first.
While I agree with most all this, I disagree with your conclusion that there's no reason to do the math. The simulator is very good, because the math is very complicated, but the math will always be better if you can actually do it. And just because it's hard doesn't mean it gives no benefit. You can actually mathematically weigh the benefits vs risk of terminal collision in your math. Or you can use experience at that point to fill in the rest of what you know without the math.

Quote
For example, say you play BM+Militia, and the "right" number of Militias for this deck at the typical end of the game would be 3 by a collisioncalculation. You would prob, quickly pick up the first, but wait for the second until near endgame to avoid colllisions. Than you want the second, and near the very end you would want the third. But to achieve that, you have to pass up on a say Gold on midgame to buy a Militia, and that's not really what you want. And for the last, you will probably never have the chance, as you will prefere Estates over Militia at this time. So either you get them early, or the opportunitycost to get them might increased.
And here your intuition is more than likely telling you wrong. You want the second almost immediately, and you want the third much quicker than you suggest here. In fact, the situations where you're talking about getting a third are probably where you should be thinking about getting a fourth - of course, this more or less assumes that your opponent has gotten at least one or two, and if he hasn't, it more-than-likely will matter very little, the only big difference being you should hold off slightly longer on each one.

#### DStu

• Margrave
• Offline
• Posts: 2627
• Respect: +1490
##### Re: Choosing the correct number of terminal actions
« Reply #11 on: September 01, 2011, 09:57:49 am »
0

Quote
For example, say you play BM+Militia, and the "right" number of Militias for this deck at the typical end of the game would be 3 by a collisioncalculation. You would prob, quickly pick up the first, but wait for the second until near endgame to avoid colllisions. Than you want the second, and near the very end you would want the third. But to achieve that, you have to pass up on a say Gold on midgame to buy a Militia, and that's not really what you want. And for the last, you will probably never have the chance, as you will prefere Estates over Militia at this time. So either you get them early, or the opportunitycost to get them might increased.
And here your intuition is more than likely telling you wrong. You want the second almost immediately, and you want the third much quicker than you suggest here. In fact, the situations where you're talking about getting a third are probably where you should be thinking about getting a fourth - of course, this more or less assumes that your opponent has gotten at least one or two, and if he hasn't, it more-than-likely will matter very little, the only big difference being you should hold off slightly longer on each one.

Ok, this was not written good enough, I indeed was talking about what a collisionprobabilityanalysis would tell you, while in reality you want to grab the Militias earlier. Even if they might collide a bit more likely than you are comfortable with in the next shuffle, because the shuffle later you don't want to spend \$6++ on them. Maybe the timing is wrong, my point was that you might want to buy cards earlier than it is "optimal", because when it is "optimal" you want to buy other cards.
But I think we agree, if I understand you correctly.
Logged

#### DStu

• Margrave
• Offline
• Posts: 2627
• Respect: +1490
##### Re: Choosing the correct number of terminal actions
« Reply #12 on: September 01, 2011, 10:14:51 am »
0

The mathematical and statistical analyses should be able to provide you with the correct gameplan for any simple strategy like this, provided you do enough math. Having said that, you have to do more math that this fellow has in order to get to that point. You need to take into account when you can buy the different cards (money, actions, victory), and buy with a view to the probabilities of what will come up in the future. In fact I have done these kind of analyses myself, ad in general I don't actually use them, because I am lazy, but when I am serious, I will sit and calculate things for quite a while when choosing my strategy.

The point is, from my perspective if you consider all this, the (joint) distribution of your draws, the once of your opponent and the possible choices you make at your turns, you just end up with quite high-dimensional integrals given these choices. Of course you can now out of ambition look for a closed formula for this integral (or better all these integrals, given the choices, given opponent). Or you can integrate it numerically with, say, a Monte Carlo method, which should be the canonical candidate for high dimensional integrals. So you end up in the simulator. You can calculate by hand what is possible, but somewhere along the road you just hit the barrier, where it is just to time-consuming to do it by hand or exactly.
Logged

• Margrave
• Offline
• Posts: 2830
• You make your own shuffle luck
• Respect: +3878
##### Re: Choosing the correct number of terminal actions
« Reply #13 on: September 01, 2011, 10:26:27 am »
0

First off, I guess I should say that I don't feel like anyone has been dismissive of my idea. I have nothing but respect for people who look at this and say "that's not useful to me"; I haven't seen much of "that's not useful at all". I'm not good at Dominion, and I understand that the people who are good at Dominion use what they call an intuition or a feeling for how to create a good deck. For very specific types of engines, I have experienced this feeling, so I totally understand what the goal is. I also realize that once I've reached that goal, computing %collision will not really be useful.

However, I'm not there yet. I don't know what a deck "feels like" that properly uses terminal actions while avoiding collisions. I've defined %collision as a way to help me understand that; it gives me a starting point for me to analyze the effects of my deck on the collision of terminal actions in my deck.

This is not for everybody. I like numbers a lot more than most people. I did some AI work in grad school, so it's kind of funny that someone else who thinks in a similar way is interested in AI.

However, I feel like people don't need to fully understand %collision or any of the math-related things in order to help and provide information. This was my intent when I was talking about "what are the right questions to ask?" but looking back I wasn't clear...

If people tell me things like "When I buy Militia with no Villages present, I usually end up buying X of them. If I want to buy any more of them, then I'll just buy a silver instead." or "When I buy Witch, I buy Y of them. They collide a lot but it's worth it because [...]" then that's very helpful. I can convert these pieces of knowledge, from people who have built successful decks that "feel" good, into %collision numbers.

I'm hoping to come up with a list of terminal actions where this %collision metric is useful and compare them. The first step to that is to find out which terminal actions benefit from this analysis, and which of them will benefit more from a different way of looking at them.

DSTu - you have raised a few good points.

first, about the three-card collision formula. You are right, I didn't consider that case. I'll have to look at the math more closely, but I think a good approximation for taking this into account would be a multiplier of 2.5 times the two-terminal-actions number instead of 2. I'll edit the original post once I come up with a number I feel good about.

second, about Chancellor, I suppose Chancellor wouldn't mess with the math in the way I thought it would, but the %collision metric was designed to be used like this: you go through your deck once, which means that in a perfect world you could play the card once. A collision is the only thing that could stop you, how often does that happen? The likelihood of that determines how much you actually get to play your card. If you're playing Chancellor and shuffling constantly, the metric doesn't make sense, and it seems your strategy for buying them doesn't rely on worrying about collisions. I think Chancellor is best excluded from this analysis.
Logged
Visit my blog for links to a whole bunch of Dominion content I've made.

#### DStu

• Margrave
• Offline
• Posts: 2627
• Respect: +1490
##### Re: Choosing the correct number of terminal actions
« Reply #14 on: September 01, 2011, 10:36:43 am »
0

I'm hoping to come up with a list of terminal actions where this %collision metric is useful and compare them. The first step to that is to find out which terminal actions benefit from this analysis, and which of them will benefit more from a different way of looking at them.
I don't have a list, the simulator was mentioned, I provide a link in the case you don't know it: http://dominionsimulator.wordpress.com/
Just play with the _Single stratgies and let them buy N Militias/Witches/whatever against BM or themselfes and optimize it. The simulator works quite well for BM, and in general if the strategy does not include any trashing or other difficult choices.
Logged

• Margrave
• Offline
• Posts: 2830
• You make your own shuffle luck
• Respect: +3878
##### Re: Choosing the correct number of terminal actions
« Reply #15 on: September 01, 2011, 10:37:35 am »
0

Some more great discussion about Militia: if someone is playing Militia on you, your hand size is smaller sometimes, which means your probability of a collision is smaller! If you're getting Militia-ed every other turn, your average hand size is 4 cards instead of 5, so %collision really equals something like this:

%collision = (avg. hand size - 1)/(deck size - 1)

...and then extend this two-militia formula to account for three militias. This helps to justify buying more militias. Brilliant.

Also, DSTu, you were talking about how the math gets really complicated. You are correct. This is why I'm trying to make approximations as much as I can. I don't expect this %collision business to get so much time put into it that it gets super-precise. When I'm playing, the difference between a %collision of 21% and 23% is next to nothing. I don't intend to play face-to-face games with people and have a calculator (or worse, a simulator) running next to me. I'll come up with a number from my formula that is within 5% which will help me to determine whether or not buying that next terminal action is either:

1) a no-brainer. Do it.
2) a no-brainer. Don't do it.
or
3) somewhere in that grey area, where I need to use my "intuition"

For a beginner like me, who also likes numbers, having a metric like this will help me to more easily gain that intuition.
Logged
Visit my blog for links to a whole bunch of Dominion content I've made.

#### DStu

• Margrave
• Offline
• Posts: 2627
• Respect: +1490
##### Re: Choosing the correct number of terminal actions
« Reply #16 on: September 01, 2011, 10:46:11 am »
0

Some more great discussion about Militia: if someone is playing Militia on you, your hand size is smaller sometimes, which means your probability of a collision is smaller! If you're getting Militia-ed every other turn, your average hand size is 4 cards instead of 5, so %collision really equals something like this:

%collision = (avg. hand size - 1)/(deck size - 1)

...and then extend this two-militia formula to account for three militias. This helps to justify buying more militias. Brilliant.
Dont't think that you want to see it that way. If you draw a hand of 2xMilitia+3xX, and you discard one of the Militia due to an opponents Militia, that's still a collision. You wont play the second Militia. Of course, if X=Gold, then maybe it's not so bad, but if X=Estate, then it's a full collision as before. So say on average, say you "may" keep a Copper when discarding the Milita, then it's somehow half a collision, as you only loose \$1 compared to the szenario where the Milita was a Silver instead of \$2 as in a full collision.

Quote
Also, DSTu, you were talking about how the math gets really complicated. You are correct. This is why I'm trying to make approximations as much as I can. I don't expect this %collision business to get so much time put into it that it gets super-precise. When I'm playing, the difference between a %collision of 21% and 23% is next to nothing. I don't intend to play face-to-face games with people and have a calculator (or worse, a simulator) running next to me. I'll come up with a number from my formula that is within 5% which will help me to determine whether or not buying that next terminal action is either:

That's why I'm constantly advertising the simulator. You are talking about quite easy tactics that it can handle, and the approximation error will be much smaller (indeed arbitrarily small if you have enough time) if you just simulate. There you get easy rules-of-thumbs of how many cards of which type you want to have in a deck.  Of course, for some not expected szenario it is also usefull to now the approximate probs of a collision to rate the usefullness of a buy in this concretesituation. But for further questions, I think one should ask the sim.
Logged

#### DStu

• Margrave
• Offline
• Posts: 2627
• Respect: +1490
##### Re: Choosing the correct number of terminal actions
« Reply #17 on: September 01, 2011, 10:55:23 am »
0

Sp perhaps for some more intuition, which is at least partly simulator-assisted: If I play BM+X, how many cards of X do I want to have (just Baseset):

Quote
Chapel - 1
Council Room - 1, later a second one if the draws are right for it.
Library - not sure, prob 2-3
Militia - 2, later 3
Mine - not sure, prob 1-2
Moneylender - 1
Smithy - 1, if it fits a second one late
Witch - 2
Woodcutter - 1, but there most be a lot happening for playing BM+Woodcutter
the missing ones I would not really play BM+X. "later" is really later, when I've bought 1-2 Provinces. But depending on your opponent you might also prefer Duchies at this point already.
Logged

#### DG

• Governor
• Offline
• Posts: 4074
• Respect: +2624
##### Re: Choosing the correct number of terminal actions
« Reply #18 on: September 01, 2011, 11:01:45 am »
0

Quote
Come on.  There is totally a place for math and analysis like this.  You're right that in practice, the math takes a backseat to strategy on a more intuitive level, which grows out of experience.  But studying the math enough to understand on an intuitive level how shuffle luck really works, is a brilliant and fantastic mental tool that can be employed in the practice of a winning Dominion strategy.

The Dominion maths are actually pretty complicated even for decks without trashing. I had a look at the adventurer a while back and decided not to pursue many other cards as closely. There are some major problems. Firstly your deck changes after every card gained (or trashed) so you're building a tower of mathematics on shifting sand. Secondly you can't always choose your opportunities to buy cards or make assumptions on the results of future hands and the difference between having 5 (royal seal) or 6 (gold) to spend can play havoc with the maths. Thirdly the reshuffle at the end of the deck causes problems, not least because it might change your card play.

There is some value from sitting down and approaching a dominion game mathematically, trying to build a model and finding the flaws. I was able to create some equations for the adventurer and confirm that it is (approximately) better than gold when the average treasure in your deck is worth 3/2, but that is still based on inaccurate assumptions and ignores the adventurer's capability to draw past the end of the deck and miss the reshuffle. In summary, I suspect you'd need a very large piece of paper to write down the equations for Dominion, it'll generally be too complicated to work out during a game, but you might find some insight from the exercise. It's not easy to share those insights by sharing the maths.
Logged

#### Geronimoo

• Saboteur
• Offline
• Posts: 1055
• Respect: +859
##### Re: Choosing the correct number of terminal actions
« Reply #19 on: September 01, 2011, 11:27:50 am »
0

So you do some amazing math, find out that Adventurer is better than Gold as soon as the average treasure in your deck is worth 3/2, then you double check with the simulator and find out the idiot bot that buys an Adventurer at first sight will perform as well as the bot that waits until it has some nice money in its deck:

Code: [Select]
`<player name="Late Adventurer">   <buy name="Province">      <condition>         <left type="countCardsInDeck" attribute="Gold"/>         <operator type="greaterThan" />         <right type="constant" attribute="0.0"/>      </condition>   </buy>   <buy name="Duchy">      <condition>         <left type="countCardsInSupply" attribute="Province"/>         <operator type="smallerOrEqualThan" />         <right type="constant" attribute="5.0"/>      </condition>   </buy>   <buy name="Estate">      <condition>         <left type="countCardsInSupply" attribute="Province"/>         <operator type="smallerOrEqualThan" />         <right type="constant" attribute="2.0"/>      </condition>   </buy>   <buy name="Adventurer">      <condition>         <left type="countCardsInDeck" attribute="Adventurer"/>         <operator type="smallerThan" />         <right type="constant" attribute="1.0"/>      </condition>      <condition>         <left type="countCardsInDeck" attribute="Gold"/>         <operator type="greaterThan" />         <right type="constant" attribute="0.0"/>      </condition>   </buy>   <buy name="Adventurer">      <condition>         <left type="countCardsInDeck" attribute="Adventurer"/>         <operator type="smallerThan" />         <right type="constant" attribute="1.0"/>      </condition>      <condition>         <left type="countCardsInDeck" attribute="Silver"/>         <operator type="greaterThan" />         <right type="constant" attribute="4.0"/>      </condition>   </buy>   <buy name="Gold"/>   <buy name="Silver"/></player>`
Code: [Select]
`<player name="Early Adventurer">   <buy name="Province">      <condition>         <left type="countCardsInDeck" attribute="Gold"/>         <operator type="greaterThan" />         <right type="constant" attribute="0.0"/>      </condition>   </buy>   <buy name="Duchy">      <condition>         <left type="countCardsInSupply" attribute="Province"/>         <operator type="smallerOrEqualThan" />         <right type="constant" attribute="5.0"/>      </condition>   </buy>   <buy name="Estate">      <condition>         <left type="countCardsInSupply" attribute="Province"/>         <operator type="smallerOrEqualThan" />         <right type="constant" attribute="2.0"/>      </condition>   </buy>   <buy name="Adventurer">      <condition>         <left type="countCardsInDeck" attribute="Adventurer"/>         <operator type="smallerThan" />         <right type="constant" attribute="1.0"/>      </condition>   </buy>   <buy name="Gold"/>   <buy name="Silver"/></player>`
Logged

#### WanderingWinder

• Offline
• Posts: 5275
• ...doesn't really matter to me
• Respect: +4380
##### Re: Choosing the correct number of terminal actions
« Reply #20 on: September 01, 2011, 11:33:43 am »
0

That's because, rather obviously, you should anticipate somewhat what your deck WILL be like as opposed to buying for what it IS like right now.

#### guided

• Jester
• Offline
• Posts: 940
• Respect: +93
##### Re: Choosing the correct number of terminal actions
« Reply #21 on: September 01, 2011, 11:45:32 am »
0

Also, an early Adventurer will provide beneficial deck cycling.
Logged

#### MasterAir

• Alchemist
• Offline
• Posts: 39
• Respect: +8
##### Re: Choosing the correct number of terminal actions
« Reply #22 on: September 05, 2011, 01:01:49 pm »
0

Quote
So you do some amazing math, find out that Adventurer is better than Gold as soon as the average treasure in your deck is worth 3/2, then you double check with the simulator and find out the idiot bot that buys an Adventurer at first sight will perform as well as the bot that waits until it has some nice money in its deck:

And usually worse than the player who just bought Gold?
Logged

#### Thisisnotasmile

• Saboteur
• Offline
• Posts: 1493
• Respect: +675
##### Re: Choosing the correct number of terminal actions
« Reply #23 on: September 05, 2011, 01:20:34 pm »
0

Quote
So you do some amazing math, find out that Adventurer is better than Gold as soon as the average treasure in your deck is worth 3/2, then you double check with the simulator and find out the idiot bot that buys an Adventurer at first sight will perform as well as the bot that waits until it has some nice money in its deck:

And usually worse than the player who just bought Gold?

Single Adventurer beats BMU 49% - 42%.
Logged

• Margrave
• Offline
• Posts: 2830
• You make your own shuffle luck
• Respect: +3878
##### Re: Choosing the correct number of terminal actions
« Reply #24 on: September 06, 2011, 11:16:59 am »
0

I've crunched some numbers using the simulator and I have the first result!

In all of my simulations, buying the second Smithy only took precedence over buying a Silver, and was only permitted after the total number of cards in the deck was at least n (the independent variable here).

I compared BMU + 1 Smithy with different variations of BMU + 2 Smithys to try and find out when the "best" time to buy the second Smithy was (how many total cards are in your deck, n, when you buy the second Smithy). By seeing which values of n have a higher win rate than BMU + 1 Smithy, we can get a range of values where "buying the second Smithy is better than not buying it". These n-values can also be converted to a %collision value.

Results: The domain of n-values where I allowed the purchase of the second Smithy divided the results into three sections. The apparent boundaries between these three sections are the variables of interest. I'll call the three sections:

Better Than BMU + 1 Smithy
Not Worse Than BMU + 1 Smithy
Worse than BMU + 1 Smithy

The "Better" and "Worse" regions should be fairly clear what they mean, but the "Not Worse" is where I saw a lot of variance. It would be nice to be able to run simulations of more than 10000 games at once, but if I run ten 10000-game simulations, I'd have to see a higher win rate for at least 8 of them or else it's in "Not Worse".

The following is the range of n-values, split into these three regions:

13   : Worse than BMU
14-16: Not Worse than BMU
>= 17: Better than BMU

The trend of these results is not surprising, but I was expecting lower %collision values than what I ended up seeing! Using the %collision = 7/(n-1) formula for a Smithy deck, we arrive at the following values:

Better than BMU   : 17 cards, %collision = 43.75%
Not worse than BMU: 14 cards, %collision = 53.85%

The wisdom here is that you gain more of an advantage by buying your second Smithy later in the game, when you have a lower risk of it colliding with your other Smithy. Before that time, you'd rather have a silver.

However, the average number of turns for these games is in the 20-22 range, meaning that your average deck size is 25-27. At some point, you're going to be buying victory point cards and the Smithy will never come up if your n-value is high enough. In the results, as I increased n, I eventually saw the win rate go down to about the same as BMU + 1 Smithy. This means that there should be an "optimal" place to buy that second Smithy. Let's find it.

Instead of comparing solely win rate differential against BMU + 1 Smithy, I decided to play the BMU + 2 Smithy strategies against each other as well. The data for each scenario seemed to line up, but it was a little easier to tell what the optimal n-value was when I played the 2-Smithy strategies against each other.

Results: I found the optimal place to buy the second Smithy to be at n=22 cards, giving a %collision = 33.33%

Optimized         : 22 cards, %collision = 33.33%
Better than BMU   : 17 cards, %collision = 43.75%
Not worse than BMU: 14 cards, %collision = 53.85%

Issues: It seems that player interaction plays a large part in the usefulness of the action cards. There is enough player interaction in the rest of the cards to be analyzed in the base deck that I'm unsure how best to test them. Even the player interaction involved in the BMU strategy is enough to make me question whether or not this is the "purest" form of the answer for %collision.

I realize that with attack cards especially, the benefit of playing an attack (or having a Moat to defend against it) can increase the %collision you're willing to tolerate, just to be able to play the action more often. With this in mind, I should more clearly state my goal of this analysis:

I want to have an "optimal" (simulation-tested) n-value where it's most appropriate to buy your next terminal action in the absence of any player interaction. Then I want to have a "worst-case" n-value, which is the highest optimal n-value over the set of all possible opponent strategies.

Perhaps this isn't possible, but maybe there is a "best-case" number that is similar to the worst-case, but I would just always think that is zero.

I believe that with these two (maybe three) values, a player would have a reference point, and along with judgement of the particular situation, he would have a decent idea of what the best %collision value is when buying his next terminal action.

Perhaps if the BMU + Smithy player is getting spammed by Militias, it would be better to buy your second Smithy sooner (or maybe even buy a third). It would be interesting to see if all of this affects the optimal %collision where you buy your next Smithy.

Information I don't know: I'll list the rest of the cards in the base set that I still want to analyze:

Council Room
Moat
Bureaucrat
Militia
Thief
Witch
Woodcutter
Workshop

Council Room seems pretty straight forward -- BMU + Council Room. Moat actually fits pretty well into this analysis as well. However, it gets more complicated for the attacks, and also for Woodcutter and Workshop. I guess I'm not quite convinced that BMU + "card X" is always the best strategy for these cards. My main question is:

If the only action card present was one of (Bureaucrat, Militia, Thief, Witch, Woodcutter, Workshop), what is the best strategy?

If the answer to this question is "BMU" without the presence of other action cards, then I think I shouldn't try and consider it yet. If there is no accepted "best" strategy yet, then at least some suggestions would be helpful. I'm sorry, I'm not very good at Dominion so I don't already know this.

I imagine the answer will be one of the following:

BMU only
BMU + x of these cards
BMU + buy this card whenever you can

except for Woodcutter/Workshop, where I'm totally stumped.

Also, it would be interesting to hear ideas on how an opponent could play that would make you want to buy as many of those cards as possible. I have some ideas (like Militia spamming with Smithy) but I'm sure more input would be very helpful.

That's all for now. Hopefully there will be more to talk about, and I'll keep thinking about more simulations to run.
Logged
Visit my blog for links to a whole bunch of Dominion content I've made.
Pages: [1] 2  All

Page created in 0.067 seconds with 21 queries.