User:Jdavis/UVs
From SpiralKnights
This guide combines basic probability theory with data collected by players, to calculate the expected cost of purchasing certain combinations of unique variants from Punch.
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.
Frequently players sell UVs for much lower prices than appear here. So you should always keep buying, rather than Punching, in mind when planning UVs. 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.)
Contents
Optimal Strategies
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.
Item Type | +1, +2, +3, +4 | +2, +3, +4 | +3, +4 | +4 |
Sword, Handgun | 160,000 | 470,588 | 1,230,770 | 2,666,667 |
Bomb | 140,000 | 411,765 | 1,076,920 | 2,333,333 |
Helmet, Suit | 200,000 | 588,235 | 1,538,460 | 3,333,333 |
Shield | 80,000 | 235,294 | 615,385 | 1,333,333 |
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).
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 |
Later, we will include a table for the expected cost of Punching a second UV on an item that already has a UV. We will also include a table and analysis for obtaining three UVs on an item.
The remainder of this guide explains the assumptions and data that go into these calculations. It also explains which strategies are considered and how their expected costs are computed.
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 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 (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 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).
Single-UV Strategies
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.
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 = 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 C2 T / 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) (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 C3 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 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).
2-UV Tickets with Locking
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.
- 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, 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 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). 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 - 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.
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). As above, 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)]
with value
- (2 C2 T + C1 T - 2 C2) / (2 P).