User:Jdavis/UVs

From SpiralKnights

< User:Jdavis
Revision as of 15:02, 8 August 2014 by Jdavis (Talk | contribs)

Jump to: navigation, search

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 and 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.

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.)

Optimal Strategies

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.

One UV

Suppose that you have an item with no UVs, and you want 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

Second UV

Suppose that your item already has one UV, and you want to add a second UV of your choice. 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,544,120 4,038,460 8,750,000
Bomb 450,000 1,323,530 3,461,540 7,500,000
Helmet, Suit 675,000 1,985,290 5,192,310 11,250,000
Shield 225,000 661,765 1,730,770 3,750,000

Two UVs

Suppose that your item 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). 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

Three UVs

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

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.

Second-UV Strategies

In this section, we have an item with one UV already (either by buying it or a single-UV strategy). The item has T UV types. We want to place a second UV on it, whose size has probability P. It's pretty clear that we want to lock that UV, while buying either 2- or 3-UV tickets for the other desired UV. It turns out that 2-UV tickets are preferable, as long as they cost less than half of what 3-UV tickets cost.

2-UV Tickets

Suppose that we buy 2-UV tickets, locking the first UV, until we obtain the second UV. On each ticket, 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 is an arithmetico-geometric series with value C2 (T - 1) / P.

3-UV Tickets

Suppose that we buy 3-UV tickets, locking the first UV, until we obtain the second UV. On each ticket, there are (T - 1)-choose-2 = (T - 1) (T - 2) / 2 possible type combinations, T - 2 of which contain the desired type. So 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).

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 previous cases, 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 discuss 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

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).

Triple-UV Strategies

This analysis is not yet finished.

Personal tools