Difference between revisions of "User:Jdavis/UVs"

From SpiralKnights

Jump to: navigation, search
(tinkering throughout)
(incorporated new data; will come back later to finish last two sections)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
This guide describes the expected cost of purchasing certain combinations of [[Unique Variant|unique variants]] from [[Punch]]. The calculations boil down to basic probability theory and data collected by players.
+
This guide describes optimal strategies for obtaining [[Unique Variant|unique variants]] (UVs) from [[Punch]]. It also tells you the expected cost of those UVs. The calculations boil down to basic probability theory combined with data collected by players.
  
''Expected cost'' is a technical term of probability, but it's not hard to understand: It's the cost for a player experiencing average luck. Some players will get lucky and obtain UVs more cheaply than expected. Other players will get unlucky and spend much more than expected, or never get a good UV at all. If many players use Punch to get a certain combination of UVs, and even the unluckiest players keep trying until they succeed, then the expected cost for that combination is the average of all of the players' costs.
+
''Expected cost'' is a technical term of probability, but it's not hard to understand: It's the cost for a player experiencing average luck. Some players will get lucky and obtain UVs more cheaply than expected. Other players will get unlucky and spend much more than expected, or never get a good UV at all. If many players use Punch, and even the unluckiest players keep trying until they succeed, then the expected cost is the average of all of the players' costs.
  
 
Frequently players sell UVs for much lower prices than appear here. So you should always consider buying UVs rather than Punching them. In fact, the costs in this guide can be taken as a maximum rational sales price. For why would a player ever pay more for a UV, than he or she would pay at Punch?
 
Frequently players sell UVs for much lower prices than appear here. So you should always consider buying UVs rather than Punching them. In fact, the costs in this guide can be taken as a maximum rational sales price. For why would a player ever pay more for a UV, than he or she would pay at Punch?
  
(Actually, he might pay more, if he were worried about the risk of spending much more than the expected cost. More nuanced decisions like this could be made using not just expected costs but also confidence intervals. This guide excludes confidence intervals, because they are too laborious to calculate in most cases.)
+
(Actually, he might pay more, if he were worried about the risk of spending much more than the expected cost. More nuanced decisions like this could be made using additional information such as confidence intervals. This guide excludes confidence intervals, because they are too laborious to calculate in most cases.)
  
==Optimal Strategies==
+
==Data, Notation, and Assumptions==
 +
 
 +
Items vary in the types of UVs available:
 +
* Swords and handguns can acquire 8 types of UVs: ASI, CTR, slime, etc.
 +
* Bombs can acquire 7 types: CTR, slime, etc.
 +
* Helmets and suits can acquire 10 types: normal, fire, etc.
 +
* Shields can acquire 4 types: normal, piercing, elemental, shadow.
 +
Let ''T'' denote the number of types of UVs on your item. For example, if you're trying to UV a sword, then ''T'' = 8. We assume that all types are equally probable and that their probabilities are independent of the ticket type and each other, except that an item cannot carry multiple UVs of the same type.
 +
 
 +
Large UVs are rarer than small UVs. The exact rates are a topic of continual study. See [[User talk:Jdavis/UVs#Data sets|here]] for an summary of several player data sets. We estimate the rates to be
 +
* +1 (Low): 505 / 718 = 70.3%
 +
* +2 (Medium): 162 / 718 = 22.6%
 +
* +3 (High): 33 / 718 = 4.6%
 +
* +4 (Very High on weapons, Maximum! on armor): 18 / 718 = 2.5%.
 +
Let ''P'' be the probability of getting the UV or UVs that you want. For example, if you are looking for a +4, then ''P'' = 0.025. If you are looking for a +3 or +4, then ''P'' = 0.071. We assume that the size of a UV is independent of the sizes of other UVs, the type of the UV, or the type of ticket.
 +
 
 +
We let ''C''<sub>1</sub>, ''C''<sub>2</sub>, ''C''<sub>3</sub> denote the prices of the 1-, 2-, and 3-UV tickets. We do all of our calculations in terms of ''C''<sub>1</sub>, ''C''<sub>2</sub>, ''C''<sub>3</sub>, ''P'', and ''T'' , so that we can easily recalculate if the prices change (such as in {{release|2011-09-06}}), the rates change (due to updates or just new data), or the number of types change (such as in {{release|2011-08-02}}).
 +
 
 +
Many of our calculations use the idea of combinations. For any integer ''N'' &ge; 0 and any ''K'' such that 0 &le; ''K'' &le; ''N'', ''N''-choose-''K'' is the number of ways to choose ''K'' objects from a set of ''N'' objects. It equals ''N''! / (''K''! (''N'' - ''K'')!). We will use mainly these cases:
 +
* ''N''-choose-1 = ''N'',
 +
* ''N''-choose-2 = ''N'' (''N'' - 1) / 2,
 +
* ''N''-choose-3 = ''N'' (''N'' - 1) (''N'' - 2) / 6.
 +
Some of our analyses also use [http://en.wikipedia.org/wiki/Arithmetico-geometric_sequence arithmetico-geometric series].
 +
 
 +
==Single-UV Strategies==
 +
 
 +
Suppose that you have an item with no UVs, and you want to get a single UV of your choice. Here are three strategies.
 +
 
 +
===1-UV Tickets===
 +
 
 +
Suppose that we buy 1-UV tickets until we obtain the desired UV. On each ticket, the probability of hitting the desired type is 1 / ''T'', and the probability of getting the desired size is ''P'', so the probability of getting the desired UV is ''P'' / ''T''. The expected number of tickets is ''T'' / ''P'', for an expected cost of ''C''<sub>1</sub> ''T'' / ''P''.
 +
 
 +
===2-UV Tickets===
 +
 
 +
Suppose that we buy 2-UV tickets until we obtain the desired UV. There are ''T''-choose-2 combinations of UV types that can be obtained. Of these, ''T'' - 1 contain the desired type. So the probability of hitting the desired type is
 +
:(''T'' - 1) / ''T''-choose-2 = 2 / ''T''.
 +
The probability of getting the desired UV on any one ticket is 2 ''P'' / ''T''. The expected number of tickets is ''T'' / (2 ''P''), and the expected cost is ''C''<sub>2</sub> ''T'' / (2 ''P'').
 +
 
 +
===3-UV Tickets===
  
This section tells you the optimal Punch strategies and their costs. The sections after this one explain the assumptions, data, strategies, and computations that produce the results here.
+
Suppose that we buy 3-UV tickets until we obtain the desired UV. There are ''T''-choose-3 = ''T'' (''T'' - 1) (''T'' - 2) / 6 combinations of UV types that can be obtained. Of these, (''T'' - 1)-choose-3 don't contain the desired type, so
 +
:''T''-choose-3 - (''T'' - 1)-choose-3 = (''T'' - 1) (''T'' - 2) / 2
 +
do contain the desired type. Thus the probability of getting the desired type is
 +
:[(''T'' - 1) (''T'' - 2) / 2] / ''T''-choose-3 = 3 / ''T'',
 +
the probability of getting the desired UV is 3 ''P'' / ''T'', the expected number of tries is ''T'' / (3 ''P''), and the expected cost is ''C''<sub>3</sub> ''T'' / (3 ''P'').
  
===One UV===
+
===Conclusion===
  
To get a single UV of your choice, your optimal Punch strategy is to purchase 1-UV tickets until you get that UV. The following table shows the expected costs of this strategy. For example, to get CTR+3 or better on a sword costs about 1,230,770 crowns.
+
Notice that all three costs contain a factor of ''T'' / ''P''. Ignoring that factor, the decision comes down to which is smallest: ''C''<sub>1</sub>, ''C''<sub>2</sub> / 2, or ''C''<sub>3</sub> / 3. At current prices, the answer is ''C''<sub>1</sub>. Therefore your optimal Punch strategy is to purchase 1-UV tickets until you get that UV. The following table shows the expected costs of this strategy. For example, to get CTR+3 or better on a sword costs about 2,252,549 crowns.
  
 
{{User:Jdavis/start}}
 
{{User:Jdavis/start}}
Line 22: Line 64:
 
{{User:Jdavis/header|+4}}
 
{{User:Jdavis/header|+4}}
 
{{User:Jdavis/row}}
 
{{User:Jdavis/row}}
{{User:Jdavis/cell5| Sword, Handgun | 160,000 | 470,588 | 1,230,770 | 2,666,667}}
+
{{User:Jdavis/cell5| Sword, Handgun | 160,000 | 539,343 | 2,252,549 | 6,382,222}}
 
{{User:Jdavis/row}}
 
{{User:Jdavis/row}}
{{User:Jdavis/cell5| Bomb | 140,000 | 411,765 | 1,076,920 | 2,333,333}}
+
{{User:Jdavis/cell5| Bomb | 140,000 | 471,925 | 1,970,980 | 5,584,444}}
 
{{User:Jdavis/row}}
 
{{User:Jdavis/row}}
{{User:Jdavis/cell5| Helmet, Suit | 200,000 | 588,235 | 1,538,460 | 3,333,333}}
+
{{User:Jdavis/cell5| Helmet, Suit | 200,000 | 674,178 | 2,815,686 | 7,977,778}}
 
{{User:Jdavis/row}}
 
{{User:Jdavis/row}}
{{User:Jdavis/cell5| Shield | 80,000 | 235,294 | 615,385 | 1,333,333}}
+
{{User:Jdavis/cell5| Shield | 80,000 | 269,671 | 1,126,275 | 3,191,111}}
 
{{User:Jdavis/end}}
 
{{User:Jdavis/end}}
  
===Two UVs===
+
==Second-UV Strategies==
  
To get two UVs of your choice, your optimal Punch strategy is to purchase 1-UV tickets until you get one of your desired UVs, and then purchase 2-UV tickets, locking that first UV, until you get the other desired UV. Here are the expected costs of this strategy, assuming that the same strength is desired on both UVs (e.g. +2 or better on both).
+
Suppose that your item already has one UV, and you want to add a second UV of your choice. Here are two strategies.
 +
 
 +
===2-UV Tickets===
 +
 
 +
Suppose that we buy 2-UV tickets, always locking the first UV, until we obtain the second UV. On each ticket, there are ''T'' - 1 second UV types that could be hit, so the probability of hitting the desired type is 1 / (''T'' - 1) and the probability of hitting the desired UV is ''P'' / (''T'' - 1). Say that we get garbage on our first ''K'' tickets, and then obtain the desired UV on the next ticket after that. The probability of this happening is (1 - ''P'' / (''T'' - 1))<sup>''K''</sup> ''P'' / (''T'' - 1), and the cost is ''C''<sub>2</sub> (''K'' + 1). The expected cost is the sum of the possible costs, weighted by their probabilities. The possibilities are indexed by ''K'' &ge; 0. So the expected cost is
 +
:SUM<sub>''K''</sub> (1 - ''P'' / (''T'' - 1))<sup>''K''</sup> ''P'' / (''T'' - 1) ''C''<sub>2</sub> (''K'' + 1).
 +
This arithmetico-geometric series has value ''C''<sub>2</sub> (''T'' - 1) / ''P''.
 +
 
 +
===3-UV Tickets===
 +
 
 +
Suppose that we buy 3-UV tickets, always locking the first UV, until we obtain the second UV. On each ticket, there are (''T'' - 1)-choose-2 possible type combinations, (''T'' - 2)-choose-2 of which do not contain the desired type, and
 +
:(''T'' - 1)-choose-2 - (''T'' - 2)-choose-2 = ''T'' - 2
 +
of which do contain the desired type. So the probability of getting the desired type is
 +
:(''T'' - 2) / (''T'' - 1)-choose-2 = 2 / (''T'' - 1),
 +
and the probability of getting the desired UV is 2 ''P'' / (''T'' - 1). Say that we get garbage on our first ''K'' tickets, and then obtain the desired UV on the next ticket after that. The probability of this happening is (1 - 2 ''P'' / (''T'' - 1))<sup>''K''</sup> 2 ''P'' / (''T'' - 1), and the cost is ''C''<sub>3</sub> (''K'' + 1). So the expected cost is
 +
:SUM<sub>''K''</sub> (1 - 2 ''P'' / (''T'' - 1))<sup>''K''</sup> 2 ''P'' / (''T'' - 1) ''C''<sub>3</sub> (''K'' + 1),
 +
which is an arithmetico-geometric series with value ''C''<sub>3</sub> (''T'' - 1) / (2 ''P'').
 +
 
 +
===Conclusion===
 +
 
 +
Both expected costs contain a factor of (''T'' - 1) / ''P''. Ignoring that factor, the decision comes down to which is smaller: ''C''<sub>2</sub> or ''C''<sub>3</sub> / 2. At current prices, ''C''<sub>2</sub> wins. So your optimal Punch strategy is to purchase 2-UV tickets, locking the first UV, until you get the second UV. Here are the expected costs.
  
 
{{User:Jdavis/start}}
 
{{User:Jdavis/start}}
Line 42: Line 104:
 
{{User:Jdavis/header|+4}}
 
{{User:Jdavis/header|+4}}
 
{{User:Jdavis/row}}
 
{{User:Jdavis/row}}
{{User:Jdavis/cell5| Sword, Handgun | 605,000 | 1,779,410 | 4,653,850 | 10,083,300}}
+
{{User:Jdavis/cell5| Sword, Handgun | 525,000 | 1,769,718 | 7,391,176 | 20,941,667}}
 
{{User:Jdavis/row}}
 
{{User:Jdavis/row}}
{{User:Jdavis/cell5| Bomb | 520,000 | 1,529,410 | 4,000,000 | 8,666,667}}
+
{{User:Jdavis/cell5| Bomb | 450,000 | 1,516,901 | 6,335,294 | 17,950,000}}
 
{{User:Jdavis/row}}
 
{{User:Jdavis/row}}
{{User:Jdavis/cell5| Helmet, Suit | 775,000 | 2,279,410 | 5,961,540 | 12,916,700}}
+
{{User:Jdavis/cell5| Helmet, Suit | 675,000 | 2,275,352 | 9,502,941 | 26,925,000}}
 
{{User:Jdavis/row}}
 
{{User:Jdavis/row}}
{{User:Jdavis/cell5| Shield | 265,000 | 779,412 | 2,038,460 | 4,416,670}}
+
{{User:Jdavis/cell5| Shield | 225,000 | 758,451 | 3,167,647 | 8,975,000}}
 
{{User:Jdavis/end}}
 
{{User:Jdavis/end}}
  
===Second UV===
+
==Double-UV Strategies==
  
Later, we will include a table for the expected cost of Punching a second UV on an item that already has a UV.
+
'''WARNING: THIS SECTION IS UNDERGOING REVISION. IT IS CURRENTLY WRONG.'''
  
===Three UVs===
+
Suppose that your item currently has no UVs, and you want to endow it with two UVs of your choice. For simplicity, we assume that the two UVs have the same size (for example, +2 or better on both). Here are three strategies.
  
We will also include a table and analysis for obtaining three UVs on an item.
+
===2-UV Tickets without Locking===
  
==Data, Notation, and Assumptions==
+
Suppose that we simply buy 2-UV tickets until the two desired UVs are obtained on a single ticket. This is obviously not the best strategy, but we discuss it first because its analysis is simple. Also, this was the main double-UV strategy until {{release|2012-04-25}} introduced locking.
  
Items vary in the types of UVs available:
+
There are ''T''-choose-2 = ''T'' (''T'' - 1) / 2 combinations of UV types, only one of which is the combination we want. Once we get that combination, the probability of getting the desired size in both UVs is ''P''<sup>2</sup>. Hence the probability of getting the desired UVs on any one ticket is 2 ''P''<sup>2</sup> / (''T'' (''T'' - 1)). The expected number of tickets is ''T'' (''T'' - 1) / (2 ''P''<sup>2</sup>), and the expected cost is ''C''<sub>2</sub> ''T'' (''T'' - 1) / (2 ''P''<sup>2</sup>).
* Swords and handguns can acquire 8 types of UVs: ASI, CTR, slime, etc.
+
* Bombs can acquire 7 types: CTR, slime, etc.
+
* Helmets and suits can acquire 10 types: normal, fire, etc.
+
* Shields can acquire 4 types: normal, piercing, elemental, shadow.
+
Let ''T'' denote the number of types of UVs on your item. For example, if you're trying to UV a sword, then ''T'' = 8. We assume that all types are equally probable and that their probabilities are independent of the ticket type and each other, except that an item cannot carry multiple UVs of the same type.
+
  
Large UVs are rarer than small UVs. The exact rates are a topic of constant study. Currently we have no reason to believe that Punch UV rates are different from crafting UV rates, for which we have more data. Here are the approximate chances.
+
===1-UV Tickets, then 2-UV Tickets===
* +1 (Low): 66%
+
* +2 (Medium): 21%
+
* +3 (High): 7%
+
* +4 (Very High on weapons, Maximum! on armor): 6%.
+
Let ''P'' be the probability of getting the UV or UVs that you want. For example, if you are looking for a +4, then ''P'' = 0.06. If you are looking for a +3 or +4, then ''P'' = 0.13. We assume that the size of a UV is independent of the sizes of other UVs, the type of the UV, or the type of ticket.
+
  
We let ''C''<sub>1</sub>, ''C''<sub>2</sub>, ''C''<sub>3</sub> denote the prices of the 1-, 2-, and 3-UV tickets. We do all of our calculations in terms of ''C''<sub>1</sub>, ''C''<sub>2</sub>, ''C''<sub>3</sub>, ''P'', and ''T'' , so that we can easily recalculate if the prices change (such as in {{release|2011-09-06}}), the rates change (due to updates or just new data), or the number of types change (such as in {{release|2011-08-02}}).
+
Suppose that we buy 1-UV tickets until we obtain one of the desired UVs. Then we buy 2-UV tickets, locking the first UV, until we obtain the second desired UV.
  
==Single-UV Strategies==
+
On each 1-UV ticket, there are three kinds of outcomes.
 +
* You get one desired UV. The probability is ''P'' / ''T''.
 +
* You get the other desired UV, with probability ''P'' / ''T''.
 +
* You get neither desired UV, with the remaining probability 1 - 2 ''P'' / ''T''.
 +
On each 2-UV ticket, the probability of getting the other desired UV is ''P'' / (''T'' - 1).
  
In this section, our goal is to obtain a single UV of probability ''P'' on an item with ''T'' UV types. The obvious strategy is to buy 1-UV tickets. Some players have asked whether 2- or 3-UV tickets might confer an advantage, in that there are multiple chances to get the desired UV type on each ticket. As we show, the 2- and 3-UV ticket strategies cost more than the 1-UV ticket strategy, even ignoring the higher cost of the tickets themselves.
+
Now say that you get garbage on your first ''K'' 1-UV tickets, a desired UV on your (''K'' + 1)th 1-UV ticket, garbage on your first ''L'' 2-UV tickets, and the other desired UV on your (''L'' + 1)th 2-UV ticket. The probability of this happening is
 +
:(1 - 2 ''P'' / ''T'')<sup>''K''</sup> (2 ''P'' / ''T'') (1 - ''P'' / (''T'' - 1))<sup>''L''</sup> (''P'' / (''T'' - 1)),
 +
and the cost is ''C''<sub>1</sub> (''K'' + 1) + ''C''<sub>2</sub> (''L'' + 1). The expected cost is a nested arithmetico-geometric series
 +
:SUM<sub>''K''</sub> SUM<sub>''L''</sub> (1 - 2 ''P'' / ''T'')<sup>''K''</sup> (2 ''P'' / ''T'') (1 - ''P'' / (''T'' - 1))<sup>''L''</sup> (''P'' / (''T'' - 1)) [''C''<sub>1</sub> (''K'' + 1) + ''C''<sub>2</sub> (''L'' + 1)],
 +
whose value is (2 ''C''<sub>2</sub> ''T'' + ''C''<sub>1</sub> ''T'' - 2 ''C''<sub>2</sub>) / (2 ''P'').
  
===1-UV Tickets===
+
Notice that the total expected cost equals ''C''<sub>1</sub> ''T'' / (2 ''P'') + ''C''<sub>2</sub> (''T'' - 1) / ''P''. Comparing this cost to earlier sections, we see that it is half the cost of a single UV plus the whole cost of a second UV. That makes sense. The first UV costs half as much because we don't care ''which'' of the two UVs we get first.
 
+
Suppose that we buy 1-UV tickets until we obtain the desired UV. On each ticket, the probability of hitting the desired type is 1 / ''T'', and the probability of getting the desired size is ''P'', so the probability of getting the desired UV is ''P'' / ''T''. The expected number of tickets is ''T'' / ''P'', for an expected cost of ''C''<sub>1</sub> ''T'' / ''P''.
+
  
 
===2-UV Tickets===
 
===2-UV Tickets===
  
Suppose that we buy 2-UV tickets until we obtain the desired UV. There are ''T''-choose-2 = ''T'' (''T'' - 1) / 2 combinations of UV types that can be obtained. Of these, ''T'' - 1 contain the desired type. So the probability of hitting the desired type is (''T'' - 1) / ''T''-choose-2 = 1 / (2 ''T''). The probability of getting the desired UV on any one ticket is ''P'' / (2 ''T''). The expected number of tickets is 2 ''T'' / ''P'', and the expected cost is 2 ''C''<sub>2</sub> ''T'' / ''P''.
+
Suppose that we buy 2-UV tickets until one of the desired UVs is obtained. Then we buy 2-UV tickets, locking the first UV, until the second desired UV is obtained.
 
+
===3-UV Tickets===
+
 
+
Suppose that we buy 3-UV tickets until we obtain the desired UV. There are ''T''-choose-3 = ''T'' (''T'' - 1) (''T'' - 2) / 6 combinations of UV types that can be obtained. Of these, (''T'' - 1) (''T'' - 2) / 2 contain the desired type. Thus the probability of getting the desired type is 1 / (3 ''T''), and the expected cost is 3 ''C''<sub>3</sub> ''T'' / ''P''.
+
 
+
==Double-UV Strategies==
+
 
+
In this section, our goal is to obtain two UVs on an item with ''T'' UV types. For simplicity, we assume that the UVs have equal probability ''P''. For example, we want +4 on both UVs, or +2 or more on both UVs, rather than +2 on one UV and +4 on the other. Compared to the single-UV case, the strategies here are more interesting and the analysis is much more complicated.
+
 
+
===2-UV Tickets without Locking===
+
 
+
Suppose that we simply buy 2-UV tickets until the two desired UVs are obtained on a single ticket. This is obviously not the best strategy, but we do it first because its analysis is simple. Also, this was the only double-UV strategy prior to the introduction of locking in {{release|2012-04-25}}.
+
 
+
There are ''T''-choose-2 = ''T'' (''T'' - 1) / 2 combinations of UV types, only one of which is the combination we want. Once we get that combination, the probability of getting the desired size in both UVs is ''P''<sup>2</sup>. Hence the probability of getting the desired UVs on any one ticket is 2 ''P''<sup>2</sup> / (''T'' (''T'' - 1)). The expected number of tickets is ''T'' (''T'' - 1) / (2 ''P''<sup>2</sup>), and the expected cost is ''C''<sub>2</sub> ''T'' (''T'' - 1) / (2 ''P''<sup>2</sup>).
+
  
===2-UV Tickets with Locking===
+
Based on the remark at the end of the preceding subsection, we can compute the expected cost as half of the cost of the first UV, plus the whole cost of the second UV. So we should get ''C''<sub>2</sub> ''T'' / (4 ''P'') + ''C''<sub>2</sub> (''T'' - 1) / ''P''. But let's check that intuition.
 
+
Suppose that we buy 2-UV tickets until one of the desired UVs is obtained. Then we buy 2-UV tickets, locking the first UV, until the second desired UV is obtained.
+
  
 
On each of the tickets in the first stage, there are four kinds of outcomes.
 
On each of the tickets in the first stage, there are four kinds of outcomes.
 
* You get both desired UVs. As explained above, the probability is 2 ''P''<sup>2</sup> / (''T'' (''T'' - 1)).
 
* You get both desired UVs. As explained above, the probability is 2 ''P''<sup>2</sup> / (''T'' (''T'' - 1)).
* You get the first desired UV but not the second. There are two ways for this to happen: You don't get the second type at all, or you get the second type but not of the correct size. These combine into a probability 2 ''P'' (''T'' - 2) / (''T'' (''T'' - 1)) + 2 ''P'' (1 - ''P'') / (''T'' (''T'' - 1)) = 2 ''P'' (''T'' - 1 - ''P'') / (''T'' (''T'' - 1)).
+
* You get the first desired UV but not the second. There are two ways for this to happen:
 +
:* You don't get the second type at all. The probability is ''P'', with probability
 +
:* You get the second type but not of the correct size.
 +
:These combine into a probability
 +
::(2 ''P'' / (''T'' (''T'' - 1))) ((''T'' - 2) + (1 - ''P'')) = 2 ''P'' (''T'' - 1 - ''P'') / (''T'' (''T'' - 1)).
 
* You get the second desired UV, but not the first, again with probability 2 ''P'' (''T'' - 1 - ''P'') / (''T'' (''T'' - 1)).
 
* You get the second desired UV, but not the first, again with probability 2 ''P'' (''T'' - 1 - ''P'') / (''T'' (''T'' - 1)).
 
* You get neither desired UV, with the remaining probability 1 - 2 ''P'' (2 ''T'' - 2 - ''P'') / (''T'' (''T'' - 1)).
 
* You get neither desired UV, with the remaining probability 1 - 2 ''P'' (2 ''T'' - 2 - ''P'') / (''T'' (''T'' - 1)).
 
On each of the tickets in the second stage, the probability of getting the other desired UV is ''P'' / (''T'' - 1).
 
On each of the tickets in the second stage, the probability of getting the other desired UV is ''P'' / (''T'' - 1).
  
One way for the game to play out is: You could get garbage for your first ''K'' tickets, and then lucky and obtain both desired UVs on the next ticket. The probability of this happening is (1 - 2 ''P'' (2 ''T'' - 2 - ''P'') / (''T'' (''T'' - 1)))<sup>''K''</sup> 2 ''P''<sup>2</sup> / (''T'' (''T'' - 1)), and the cost is ''C''<sub>2</sub> (''K'' + 1). The expected cost is the sum of the possible costs, weighted by their probabilities. The possibilities are indexed by ''K'' &ge; 0. So the expected cost is
+
One way for the game to play out is: You could get garbage for your first ''K'' tickets, and then lucky and obtain both desired UVs on the next ticket. The probability of this happening is (1 - 2 ''P'' (2 ''T'' - 2 - ''P'') / (''T'' (''T'' - 1)))<sup>''K''</sup> 2 ''P''<sup>2</sup> / (''T'' (''T'' - 1)), and the cost is ''C''<sub>2</sub> (''K'' + 1). Thus the expected cost is
 
:SUM<sub>''K''</sub> (1 - 2 ''P'' (2 ''T'' - 2 - ''P'') / (''T'' (''T'' - 1)))<sup>''K''</sup> 2 ''P''<sup>2</sup> / (''T'' (''T'' - 1)) ''C''<sub>2</sub> (''K'' + 1).
 
:SUM<sub>''K''</sub> (1 - 2 ''P'' (2 ''T'' - 2 - ''P'') / (''T'' (''T'' - 1)))<sup>''K''</sup> 2 ''P''<sup>2</sup> / (''T'' (''T'' - 1)) ''C''<sub>2</sub> (''K'' + 1).
This is an [http://en.wikipedia.org/wiki/Arithmetico-geometric_sequence arithmetico-geometric series]. Its value, which we'll call ''A'', is
+
This is an arithmetico-geometric series. Its value, which we'll call ''A'', is
 
:''C''<sub>2</sub> ''T'' (''T'' - 1) / (2 (2 ''T'' - 2 - ''P'')<sup>2</sup>).
 
:''C''<sub>2</sub> ''T'' (''T'' - 1) / (2 (2 ''T'' - 2 - ''P'')<sup>2</sup>).
  
Line 128: Line 174:
 
Overall, the expected cost of this strategy is ''A'' + 2 ''B'', because there are two symmetric ways for the second case to happen.
 
Overall, the expected cost of this strategy is ''A'' + 2 ''B'', because there are two symmetric ways for the second case to happen.
  
===1-UV Tickets, then 2-UV Tickets===
+
===Conclusion===
  
Suppose that we buy 1-UV tickets until we obtain one of the desired UVs. Then we buy 2-UV tickets, locking the first UV, until we obtain the second desired UV.
+
Your optimal Punch strategy is to purchase 1-UV tickets until you get one of your desired UVs, and then purchase 2-UV tickets, locking that first UV, until you get the other desired UV. Here are the expected costs.
  
On each 1-UV ticket, there are three kinds of outcomes.
+
{{User:Jdavis/start}}
* You get one desired UV. The probability is ''P'' / ''T''.
+
{{User:Jdavis/header|Item Type}}
* You get the other desired UV, with probability ''P'' / ''T''.
+
{{User:Jdavis/header|+1, +2, +3, +4}}
* You get neither desired UV, with the remaining probability 1 - 2 ''P'' / ''T''.
+
{{User:Jdavis/header|+2, +3, +4}}
On each 2-UV ticket, the probability of getting the other desired UV is ''P'' / (''T'' - 1).
+
{{User:Jdavis/header|+3, +4}}
 +
{{User:Jdavis/header|+4}}
 +
{{User:Jdavis/row}}
 +
{{User:Jdavis/cell5| Sword, Handgun | 605,000 | 1,779,410 | 4,653,850 | 10,083,300}}
 +
{{User:Jdavis/row}}
 +
{{User:Jdavis/cell5| Bomb | 520,000 | 1,529,410 | 4,000,000 | 8,666,667}}
 +
{{User:Jdavis/row}}
 +
{{User:Jdavis/cell5| Helmet, Suit | 775,000 | 2,279,410 | 5,961,540 | 12,916,700}}
 +
{{User:Jdavis/row}}
 +
{{User:Jdavis/cell5| Shield | 265,000 | 779,412 | 2,038,460 | 4,416,670}}
 +
{{User:Jdavis/end}}
  
Now say that you get garbage on your first ''K'' 1-UV tickets, a desired UV on your (''K'' + 1)th 1-UV ticket, garbage on your first ''L'' 2-UV tickets, and the other desired UV on your (''L'' + 1)th 2-UV ticket. The probability of this happening is
+
==Triple-UV Strategies==
:(1 - 2 ''P'' / ''T'')<sup>''K''</sup> * (2 ''P'' / ''T'') (1 - ''P'' / (''T'' - 1))<sup>''L''</sup> (''P'' / (''T'' - 1)),
+
and the cost is ''C''<sub>1</sub> (''K'' + 1) + ''C''<sub>2</sub> (''L'' + 1). As above, the expected cost is a nested arithmetico-geometric series
+
:SUM<sub>''K''</sub> SUM<sub>''L''</sub> (1 - 2 ''P'' / ''T'')<sup>''K''</sup> (2 ''P'' / ''T'') (1 - ''P'' / (''T'' - 1))<sup>''L''</sup> (''P'' / (''T'' - 1)) [''C''<sub>1</sub> (''K'' + 1) + ''C''<sub>2</sub> (''L'' + 1)]
+
with value
+
:(2 ''C''<sub>2</sub> ''T'' + ''C''<sub>1</sub> ''T'' - 2 ''C''<sub>2</sub>) / (2 ''P'').
+
  
==Second-UV Strategies==
+
'''WARNING: THIS SECTION IS UNDERGOING REVISION. IT IS CURRENTLY WRONG.'''
  
Under construction.
+
Suppose that your item currently has no UVs, and you want to endow it with three UVs of your choice. Here are the expected costs. [This analysis is not yet finished.]
  
==Triple-UV Strategies==
+
{{User:Jdavis/start}}
 
+
{{User:Jdavis/header|Item Type}}
Under construction.
+
{{User:Jdavis/header|+1, +2, +3, +4}}
 +
{{User:Jdavis/header|+2, +3, +4}}
 +
{{User:Jdavis/header|+3, +4}}
 +
{{User:Jdavis/header|+4}}
 +
{{User:Jdavis/row}}
 +
{{User:Jdavis/cell5| Sword, Handgun |  |  |  | }}
 +
{{User:Jdavis/row}}
 +
{{User:Jdavis/cell5| Bomb |  |  |  | }}
 +
{{User:Jdavis/row}}
 +
{{User:Jdavis/cell5| Helmet, Suit |  |  |  | }}
 +
{{User:Jdavis/row}}
 +
{{User:Jdavis/cell5| Shield |  |  |  | }}
 +
{{User:Jdavis/end}}

Latest revision as of 20:48, 7 September 2019

This guide describes optimal strategies for obtaining unique variants (UVs) from Punch. It also tells you the expected cost of those UVs. The calculations boil down to basic probability theory combined with data collected by players.

Expected cost is a technical term of probability, but it's not hard to understand: It's the cost for a player experiencing average luck. Some players will get lucky and obtain UVs more cheaply than expected. Other players will get unlucky and spend much more than expected, or never get a good UV at all. If many players use Punch, and even the unluckiest players keep trying until they succeed, then the expected cost is the average of all of the players' costs.

Frequently players sell UVs for much lower prices than appear here. So you should always consider buying UVs rather than Punching them. In fact, the costs in this guide can be taken as a maximum rational sales price. For why would a player ever pay more for a UV, than he or she would pay at Punch?

(Actually, he might pay more, if he were worried about the risk of spending much more than the expected cost. More nuanced decisions like this could be made using additional information such as confidence intervals. This guide excludes confidence intervals, because they are too laborious to calculate in most cases.)

Data, Notation, and Assumptions

Items vary in the types of UVs available:

  • Swords and handguns can acquire 8 types of UVs: ASI, CTR, slime, etc.
  • Bombs can acquire 7 types: CTR, slime, etc.
  • Helmets and suits can acquire 10 types: normal, fire, etc.
  • Shields can acquire 4 types: normal, piercing, elemental, shadow.

Let T denote the number of types of UVs on your item. For example, if you're trying to UV a sword, then T = 8. We assume that all types are equally probable and that their probabilities are independent of the ticket type and each other, except that an item cannot carry multiple UVs of the same type.

Large UVs are rarer than small UVs. The exact rates are a topic of continual study. See here for an summary of several player data sets. We estimate the rates to be

  • +1 (Low): 505 / 718 = 70.3%
  • +2 (Medium): 162 / 718 = 22.6%
  • +3 (High): 33 / 718 = 4.6%
  • +4 (Very High on weapons, Maximum! on armor): 18 / 718 = 2.5%.

Let P be the probability of getting the UV or UVs that you want. For example, if you are looking for a +4, then P = 0.025. If you are looking for a +3 or +4, then P = 0.071. We assume that the size of a UV is independent of the sizes of other UVs, the type of the UV, or the type of ticket.

We let C1, C2, C3 denote the prices of the 1-, 2-, and 3-UV tickets. We do all of our calculations in terms of C1, C2, C3, P, and T , so that we can easily recalculate if the prices change (such as in release 2011-09-06), the rates change (due to updates or just new data), or the number of types change (such as in release 2011-08-02).

Many of our calculations use the idea of combinations. For any integer N ≥ 0 and any K such that 0 ≤ KN, N-choose-K is the number of ways to choose K objects from a set of N objects. It equals N! / (K! (N - K)!). We will use mainly these cases:

  • N-choose-1 = N,
  • N-choose-2 = N (N - 1) / 2,
  • N-choose-3 = N (N - 1) (N - 2) / 6.

Some of our analyses also use arithmetico-geometric series.

Single-UV Strategies

Suppose that you have an item with no UVs, and you want to get a single UV of your choice. Here are three strategies.

1-UV Tickets

Suppose that we buy 1-UV tickets until we obtain the desired UV. On each ticket, the probability of hitting the desired type is 1 / T, and the probability of getting the desired size is P, so the probability of getting the desired UV is P / T. The expected number of tickets is T / P, for an expected cost of C1 T / P.

2-UV Tickets

Suppose that we buy 2-UV tickets until we obtain the desired UV. There are T-choose-2 combinations of UV types that can be obtained. Of these, T - 1 contain the desired type. So the probability of hitting the desired type is

(T - 1) / T-choose-2 = 2 / T.

The probability of getting the desired UV on any one ticket is 2 P / T. The expected number of tickets is T / (2 P), and the expected cost is C2 T / (2 P).

3-UV Tickets

Suppose that we buy 3-UV tickets until we obtain the desired UV. There are T-choose-3 = T (T - 1) (T - 2) / 6 combinations of UV types that can be obtained. Of these, (T - 1)-choose-3 don't contain the desired type, so

T-choose-3 - (T - 1)-choose-3 = (T - 1) (T - 2) / 2

do contain the desired type. Thus the probability of getting the desired type is

[(T - 1) (T - 2) / 2] / T-choose-3 = 3 / T,

the probability of getting the desired UV is 3 P / T, the expected number of tries is T / (3 P), and the expected cost is C3 T / (3 P).

Conclusion

Notice that all three costs contain a factor of T / P. Ignoring that factor, the decision comes down to which is smallest: C1, C2 / 2, or C3 / 3. At current prices, the answer is C1. Therefore your optimal Punch strategy is to purchase 1-UV tickets until you get that UV. The following table shows the expected costs of this strategy. For example, to get CTR+3 or better on a sword costs about 2,252,549 crowns.

Item Type +1, +2, +3, +4 +2, +3, +4 +3, +4 +4
Sword, Handgun 160,000 539,343 2,252,549 6,382,222
Bomb 140,000 471,925 1,970,980 5,584,444
Helmet, Suit 200,000 674,178 2,815,686 7,977,778
Shield 80,000 269,671 1,126,275 3,191,111

Second-UV Strategies

Suppose that your item already has one UV, and you want to add a second UV of your choice. Here are two strategies.

2-UV Tickets

Suppose that we buy 2-UV tickets, always locking the first UV, until we obtain the second UV. On each ticket, there are T - 1 second UV types that could be hit, so the probability of hitting the desired type is 1 / (T - 1) and the probability of hitting the desired UV is P / (T - 1). Say that we get garbage on our first K tickets, and then obtain the desired UV on the next ticket after that. The probability of this happening is (1 - P / (T - 1))K P / (T - 1), and the cost is C2 (K + 1). The expected cost is the sum of the possible costs, weighted by their probabilities. The possibilities are indexed by K ≥ 0. So the expected cost is

SUMK (1 - P / (T - 1))K P / (T - 1) C2 (K + 1).

This arithmetico-geometric series has value C2 (T - 1) / P.

3-UV Tickets

Suppose that we buy 3-UV tickets, always locking the first UV, until we obtain the second UV. On each ticket, there are (T - 1)-choose-2 possible type combinations, (T - 2)-choose-2 of which do not contain the desired type, and

(T - 1)-choose-2 - (T - 2)-choose-2 = T - 2

of which do contain the desired type. So the probability of getting the desired type is

(T - 2) / (T - 1)-choose-2 = 2 / (T - 1),

and the probability of getting the desired UV is 2 P / (T - 1). Say that we get garbage on our first K tickets, and then obtain the desired UV on the next ticket after that. The probability of this happening is (1 - 2 P / (T - 1))K 2 P / (T - 1), and the cost is C3 (K + 1). So the expected cost is

SUMK (1 - 2 P / (T - 1))K 2 P / (T - 1) C3 (K + 1),

which is an arithmetico-geometric series with value C3 (T - 1) / (2 P).

Conclusion

Both expected costs contain a factor of (T - 1) / P. Ignoring that factor, the decision comes down to which is smaller: C2 or C3 / 2. At current prices, C2 wins. So your optimal Punch strategy is to purchase 2-UV tickets, locking the first UV, until you get the second UV. Here are the expected costs.

Item Type +1, +2, +3, +4 +2, +3, +4 +3, +4 +4
Sword, Handgun 525,000 1,769,718 7,391,176 20,941,667
Bomb 450,000 1,516,901 6,335,294 17,950,000
Helmet, Suit 675,000 2,275,352 9,502,941 26,925,000
Shield 225,000 758,451 3,167,647 8,975,000

Double-UV Strategies

WARNING: THIS SECTION IS UNDERGOING REVISION. IT IS CURRENTLY WRONG.

Suppose that your item currently has no UVs, and you want to endow it with two UVs of your choice. For simplicity, we assume that the two UVs have the same size (for example, +2 or better on both). Here are three strategies.

2-UV Tickets without Locking

Suppose that we simply buy 2-UV tickets until the two desired UVs are obtained on a single ticket. This is obviously not the best strategy, but we discuss it first because its analysis is simple. Also, this was the main double-UV strategy until release 2012-04-25 introduced locking.

There are T-choose-2 = T (T - 1) / 2 combinations of UV types, only one of which is the combination we want. Once we get that combination, the probability of getting the desired size in both UVs is P2. Hence the probability of getting the desired UVs on any one ticket is 2 P2 / (T (T - 1)). The expected number of tickets is T (T - 1) / (2 P2), and the expected cost is C2 T (T - 1) / (2 P2).

1-UV Tickets, then 2-UV Tickets

Suppose that we buy 1-UV tickets until we obtain one of the desired UVs. Then we buy 2-UV tickets, locking the first UV, until we obtain the second desired UV.

On each 1-UV ticket, there are three kinds of outcomes.

  • You get one desired UV. The probability is P / T.
  • You get the other desired UV, with probability P / T.
  • You get neither desired UV, with the remaining probability 1 - 2 P / T.

On each 2-UV ticket, the probability of getting the other desired UV is P / (T - 1).

Now say that you get garbage on your first K 1-UV tickets, a desired UV on your (K + 1)th 1-UV ticket, garbage on your first L 2-UV tickets, and the other desired UV on your (L + 1)th 2-UV ticket. The probability of this happening is

(1 - 2 P / T)K (2 P / T) (1 - P / (T - 1))L (P / (T - 1)),

and the cost is C1 (K + 1) + C2 (L + 1). The expected cost is a nested arithmetico-geometric series

SUMK SUML (1 - 2 P / T)K (2 P / T) (1 - P / (T - 1))L (P / (T - 1)) [C1 (K + 1) + C2 (L + 1)],

whose value is (2 C2 T + C1 T - 2 C2) / (2 P).

Notice that the total expected cost equals C1 T / (2 P) + C2 (T - 1) / P. Comparing this cost to earlier sections, we see that it is half the cost of a single UV plus the whole cost of a second UV. That makes sense. The first UV costs half as much because we don't care which of the two UVs we get first.

2-UV Tickets

Suppose that we buy 2-UV tickets until one of the desired UVs is obtained. Then we buy 2-UV tickets, locking the first UV, until the second desired UV is obtained.

Based on the remark at the end of the preceding subsection, we can compute the expected cost as half of the cost of the first UV, plus the whole cost of the second UV. So we should get C2 T / (4 P) + C2 (T - 1) / P. But let's check that intuition.

On each of the tickets in the first stage, there are four kinds of outcomes.

  • You get both desired UVs. As explained above, the probability is 2 P2 / (T (T - 1)).
  • You get the first desired UV but not the second. There are two ways for this to happen:
  • You don't get the second type at all. The probability is P, with probability
  • You get the second type but not of the correct size.
These combine into a probability
(2 P / (T (T - 1))) ((T - 2) + (1 - P)) = 2 P (T - 1 - P) / (T (T - 1)).
  • You get the second desired UV, but not the first, again with probability 2 P (T - 1 - P) / (T (T - 1)).
  • You get neither desired UV, with the remaining probability 1 - 2 P (2 T - 2 - P) / (T (T - 1)).

On each of the tickets in the second stage, the probability of getting the other desired UV is P / (T - 1).

One way for the game to play out is: You could get garbage for your first K tickets, and then lucky and obtain both desired UVs on the next ticket. The probability of this happening is (1 - 2 P (2 T - 2 - P) / (T (T - 1)))K 2 P2 / (T (T - 1)), and the cost is C2 (K + 1). Thus the expected cost is

SUMK (1 - 2 P (2 T - 2 - P) / (T (T - 1)))K 2 P2 / (T (T - 1)) C2 (K + 1).

This is an arithmetico-geometric series. Its value, which we'll call A, is

C2 T (T - 1) / (2 (2 T - 2 - P)2).

The other way for the game to play out is: You get garbage for your first K tickets, the first desired UV on your (K + 1)th ticket, garbage on the next L tickets, and the other desired UV on the ticket after that. The probability of this happening is

(1 - 2 P (2 T - 2 - P) / (T (T - 1)))K 2 P (T - 1 - P) / (T (T - 1)) (1 - P / (T - 1))L P / (T - 1),

and the cost is C2 (K + L + 2). So the expected cost is

SUMK SUML (1 - 2 P (2 T - 2 - P) / (T (T - 1)))K 2 P (T - 1 - P) / (T (T - 1)) (1 - P / (T - 1))L P / (T - 1) C2 (K + L + 2),

which is a nested arithmetico-geometric series. Its value, which we'll call B, is

C2 (T - 1) (4 + 2 P2 + 6 P - 7 P T - 9 T + 5 T2) / (2 P (2 + P - 2 T)2).

Overall, the expected cost of this strategy is A + 2 B, because there are two symmetric ways for the second case to happen.

Conclusion

Your optimal Punch strategy is to purchase 1-UV tickets until you get one of your desired UVs, and then purchase 2-UV tickets, locking that first UV, until you get the other desired UV. Here are the expected costs.

Item Type +1, +2, +3, +4 +2, +3, +4 +3, +4 +4
Sword, Handgun 605,000 1,779,410 4,653,850 10,083,300
Bomb 520,000 1,529,410 4,000,000 8,666,667
Helmet, Suit 775,000 2,279,410 5,961,540 12,916,700
Shield 265,000 779,412 2,038,460 4,416,670

Triple-UV Strategies

WARNING: THIS SECTION IS UNDERGOING REVISION. IT IS CURRENTLY WRONG.

Suppose that your item currently has no UVs, and you want to endow it with three UVs of your choice. Here are the expected costs. [This analysis is not yet finished.]

Item Type +1, +2, +3, +4 +2, +3, +4 +3, +4 +4
Sword, Handgun
Bomb
Helmet, Suit
Shield
Personal tools