# Sticker Collections

This tool was developed after I wrote a blog post about sticker collections. The aim is to quickly check whether it is more likely better to swap a number of stickers or just buy more packets, given the number of stickers you still have to collect. It uses the expectation of the number of additional stickers obtained when buying more packets to identify whether it's likely more cost effective to buy or swap.

Although I've tested the code, it's mainly a prototype toy, so please forgive any errors (and also, please let me know!). Be aware that the tool only gives an indication of the best decision to make based on cost alone and the expected number of additional stickers gained as you buy more packets. The optimal solution depends on how many other swaps you can make and the spare stickers you need to make those swaps. Also note that the last point on the graph's x axis may not be correctly spaced when it shows the number of stickers due to a limitation of the version of Chart.js that I'm using and the fact that, by definition, you can't collect more distinct stickers than the total number available.

## Query

Compare the cost of swapping stickers vs buying more packets

See how much stickers you expect from a certain number of packets

See how many packets are required for a certain number of stickers

## Result

## Options

Parameter | HTTP GET | Description |
---|---|---|

Query | type | Type of query: swaps, expectation or required |

Total stickers | total | The total number of stickers in the album |

Num remaining | remaining | The number of stickers left to complete the collection |

Num per packet | perpack | The number of stickers in each packet you buy |

Packet price | price | The price of each packet of stickers |

Num packets | packs | The number of packets of additional stickers you will buy, to calculate the expected number of distinct new stickers you will get from them |

Num new stickers | new | The number of new stickers you want, to calculate the number of packets you'd expect to need to get this number of distinct tickets |

Num to swap | swap | The number of distinct stickers you've got to swap, to calculate whether it's worth swapping those stickers or buying new ones |

Postage price | postage | The price of posting those stickers you'd consider swapping |