# Math on the Lockboxes

## Contents

[show]**UPDATE!**

*This blog post undertakes the problem "How many lockboxes do I need, at a minimum, to have a good chance at getting Magneto?" with the assumption that all comic book covers are received with equal chances. User posts, however, imply otherwise - people have been getting Magneto (via Gold purchases) with amounts roughly at the 150 range. In which case, the math listed below will be totally wrong, and the values listed can be considered as the upper bounds instead of the norm.*

**Intro to the Problem**

Hello! With the release of Spec Ops 6, the chance of recruiting Magneto also arises. The gimmick to get old Mags is to open Magnetic Lockboxes to get comic books, of which there are eight different variants. Get all 8 and you get Magneto.

Opening a single lockbox gives you a 7% chance of getting what we need, which is unreliably low. Open 10 boxes at once gives you a 100% chance.

I'll attempt to answer the question (that no one probably was asking) "How many lockboxes do I need, at a minimum, to have a good chance at getting Magneto?"

**The Algorithm** **(and Results)**

Since I could not derive a combinatorics formula for this (Which according to wikipedia, is called the Coupon Collector's Problem), I decided to use brute force. I ran a program that basically goes like this:

- Receive one of eight possible outcomes. Do this
**n**times. - Afterwards, check if we got all eight. If yes, mark this run as a success.
- Repeat the run an arbitrarily large (I pegged it at 1000) number of times, then count the successes. (I even repeated the repetitions, just to check for flukes.)
- Dividing the number of successes by 1000 gives us an estimate of our chances of completing it with
**n**x 10 lockboxes. - We are going by the assumption that each comic book has an equal chance of coming up, and Playdom does not give you a more favorable chance of getting the ones you don't have.

Number of times we opened 10 lockboxes | Number of times we got all eight out of 1000 runs (comma delimited on even more repeated testing) |
---|---|

11 | 56, 59, 57 |

12 | 92, 103, 80 |

13 | 142, 134, 149 |

14 | 206, 175, 193 |

15 | 241, 226, 234 |

16 | 295, 289, 274 |

17 | 386, 365, 359 |

18 | 420, 407, 436 |

19 | 459, 486, 499 |

20 | 533, 542, 528 |

21 | 586, 573, 606 |

22 | 660, 635, 630 |

23 | 667, 655, 698 |

24 | 703, 694, 709 |

25 | 727, 745, 740 |

26 | 759, 771, 781 |

27 | 772, 785, 786 |

28 | 826, 825, 808 |

29 | 846, 823, 839 |

30 | 849, 852, 855 |

31 | 866, 863, 876 |

32 | 897, 903, 897 |

33 | 909, 904, 899 |

**What do the numbers mean?**

For example, if we open only 11 times (110 lockboxes) the chances of getting all the comic books is only ~57/1000... which equates to between 5 and 6%. So you're pretty damn lucky if you get Magneto with only 110 lockboxes.

By the time we get to 19 and 20 (190/200 lockboxes), we are looking at a roughly 50% chance of completing the challenge. Going even further down, 33 chances (330 lockboxes) gives us a 90% chance of getting them all.

**Caveats**

Do note that the percentages do not pertain to each opening, but to the number of times we open lockboxes as a whole. Like flipping a coin eight times and coming up with eight heads, the ninth coinflip does not change your 50/50 odds. Same applies here: the 25th time you open lockboxes still gives you a 1/8 chance of getting a comic book cover.

**What does this mean for me?**

Nothing, whatsoever! Well, not exactly. This post merely shows you how the Magneto collecting odds are going to play out for you. If you ever get 300 lockboxes you have a very good chance of nabbing all eight, and if you don't, you're pretty unlucky.

**What else?**

I just like math. =P But I'd like to get a proper formula for the whole problem, so if you know your stuff, please share! Also, if you want, I can tweak the program to repeat the experiment more than 1000 times, just to be thorough.