Lockpick

* Normal

This thief's tool bears the engraving of a rabbit. Also, an engraving that reads "Black Rabbit's, hands off!" Further down it also reads "Seriously!"

## GUID

Item: 4cf72d4585f64a95b4d614bd559e4d58
Effect: 5e209720547a49d38cbdbfe623b9af06

****Lockpick**** is a relic item in *UnderMine*. It costs **2** Minor Curses and **1** Major Curse at Sho'guul's lair.

It unlocks doors, chests, and blocks without consuming the peasant's keys. Each time it is used, its probability to break goes up by 2%. Its chance, in percentage, can be found on the relic's icon. The lockpick will still spare the use of a key when it breaks.

It can be combined with Lucky Charm to obtain the Lucky Lockpick.

On average, it is worth about 9.5 Keys (See derivation below).

The chance of the lockpick breaking can be reset to 0 by placing it on the Relic Altar and removing it.

## Interactions

### Positive

* Lucky Charm: Combines into the Lucky Lockpick.
* Key Blade: More keys saved is more damage had with Key Blade.

## Statistical Analysis of the Lockpick

A statistical analysis is useful for determining how many keys finding the lock pick will save you. The following sections will walk through the derivation and steps taken to determine the statistics behind the item.

### Derivation of the Probability Density Function

Let X be the number of keys the lockpick saves the peasant. Since the lockpick saves the peasant a key even when it breaks, the minimum number of keys saved is 2 and the maximum number of keys saved is 51.

Therefore, X = {2, 3, …, 50, 51}.

In order to derive the average number of keys the lockpick will save the peasant, a probability density function (PDF) must be found. To derive this expression, let f(X) be the probability of the lockpick **not** breaking until the point of breaking for X number of saved keys. Similarly, let g(X) be the probability of the lockpick breaking for X number of saved keys. Constructed below is a table of f(X) and g(X) for early values of X.

 A complete table canbe found here.

From the table, it is easy to see a linear relationship between the probabilities of breaking (or not breaking), and the amount of keys the lockpick has saved the peasant. These relationships can be expressed using:

f
(
X
# )
1.04
−
0.02
X

{\displaystyle f(X) = 1.04 - 0.02X }

g
(
X
# )
0.02
(
X
−
1
)

{\displaystyle g(X) = 0.02 (X-1) }

Now that the probabilities of breaking and not breaking for the number of saved keys in known, it is possible to derive the PDF for the number of keys saved. The probability for saving X amount of keys is equal to the probability of the lockpick surviving X-1 times and breaking on the Xth try.

Therefore:

P
X

(
X
# )
g
(
X
)

∏

# i
2

X

f
(
i
)

{\displaystyle P\_X(X) = g(X) \prod\_{i=2}^X f(i) }

=
0.02
(
X
−
1
)

∏

# i
2

X

1.04
−
0.02
i

{\displaystyle = 0.02(X-1) \prod\_{i=2}^X 1.04 -0.02i }

A quick check of the summation of probability across the entire sample space shows that the probability of all events is 1:

∑

# X
2

51

0.02
(
X
−
1
)

∏

# i
2

X

1.04
−
0.02
# i
1

{\displaystyle \sum\_{X=2}^{51} 0.02(X-1) \prod\_{i=2}^X 1.04 -0.02i = 1 }

### Mean and Variance

Now that the PDF of the amount of keys saved is known, all that is needed now is to apply the definitions of mean and variance.

Mean is calculated by:

E
[
X
# μ

∑

k

k

P
X

(
k
)

{\displaystyle E[X] = \mu = \sum\_{}^{k} k P\_X(k) }

Variance is calculated by:

V
a
r
(
X
# )

σ
2

=

∑

k

(
k
−
μ

)
2

P
X

(
k
)

{\displaystyle Var(X) = \sigma^2 = \sum\_{}^{k} (k-\mu)^2 P\_X(k) }

Applying these definitions results in:

E
[
X

# k
2

51

0.02
k
(
k
−
1
)

∏

# i
2

k

1.04
−
0.02
# i
9.54

{\displaystyle E[X] = \sum\_{k=2}^{51} 0.02k(k-1) \prod\_{i=2}^k 1.04 -0.02i = 9.54 }

V
a
r
(
X

# k
2

51

0.02
(
k
−
μ

)
2

(
k
−
1
)

∏

# i
2

k

1.04
−
0.02
# i
18.47

{\displaystyle Var(X) = \sum\_{k=2}^{51} 0.02(k-\mu)^2(k-1) \prod\_{i=2}^k 1.04 -0.02i = 18.47 }

Thus, the lockpick, on average, will save the peasant 9.5 keys.

## Notes

* Will not replace key-based payment when buying something from Black Rabbit.