# Optimizing data usage among pooled rate plans

I'm looking for some starting tips for mathematically characterising the following problem:

There are some cellular devices, each with a rate plan consisting of an amount of data and a price, like 1MB at $3/month, 5MB at $7/month, etc. Each rate plan forms a pool: if 5 devices are on the 1MB rate plan, the total data limit is 5MB, and costs a total of \$25/month. If an individual device goes over 1MB, it doesn't matter as long as the pool doesn't exceed the pool limit (5MB).

Each device has an unpredictable data usage per month: one month, it might use 0.01KB/day except for one day that uses 1MB.

The goal is to spend as little money as possible. I can think of various responses, but I need a quantitative framework for evaluating those responses:

• When a pool is near a limit, select the top n data-using devices and put them in the next rate plan up
• Evaluate past usage and put into the "best" rate plan
• How do we determine what the best plans for which devices are? Tier devices by data usage thresholds? How to determine what the thresholds are?
• How to define the constraint that the total cost is as low as possible?