140 likes | 281 Views
Exact Analysis of Exact Change. Yair Frankel, CertCo Boaz Patt-Shamir, Northeastern University Yiannis Tsiounis, Northeastern University/GTE. At the bank. YOU: I would like to withdraw N shekels… THE TELLER: How would you like to have it? YOU: hmm… I need to make a few exact payments.
E N D
Exact Analysis of Exact Change Yair Frankel, CertCo Boaz Patt-Shamir, Northeastern University Yiannis Tsiounis, Northeastern University/GTE
At the bank... • YOU: I would like to withdraw N shekels… • THE TELLER: How would you like to have it? • YOU: hmm… I need to make a few exact payments... Northeastern University/ GTE Laboratories
Easy cases • No restrictions: up toNpayments (the N-payment problem) • N1-coins are necessary and sufficient • For N = 2m-1: allocate coins 1, 2, 4, 8,..., 2m-1 • pay by the binary representation of P • A single payment of any value P N (the 1-payment problem) Northeastern University/ GTE Laboratories
The k-payment problem Withdraw budget N to enable karbitrary payments with minimal number of coins We need algorithms for: • Coin allocation • Coin dispensing Northeastern University/ GTE Laboratories
Applications • Physical cash • Minimize coins in physical withdrawals • “Exact change” ATM machines • Electronic cash: smart cards have limited storage, electronic coins are long sequences... • Construct e-cash systems allowing exact payments • Other resource sharing scenarios Northeastern University/ GTE Laboratories
A simple solution • Replicatethe 1-payment solution ktimes : • Split budget into k portions of size N/kand solve for 1-payment for each portion • Requires about klog2(N/k) coins However... • How about payments larger than N/k? • What if N/k is not of the form 2m-1? • Is this the best solution? Northeastern University/ GTE Laboratories
Our results • Main result: The optimal solution has about kln(N/k) coins for anyN, k • Result extends to any set of allowed denominations (With greedy dispensing, the “binary” solution works for payments N/k) Northeastern University/ GTE Laboratories
This talk... • Some intuition for the lower bound • Description of the coin allocation algorithm • Idea for restricted denominations Northeastern University/ GTE Laboratories
The lower bound • Idea: the difficult cases are those where payments are equal • For k payments of 1: need k 1-coins • For k payments of 2: need additional k/2 2-coins... • In general: need k/i coins of value i, therefore total #coins is at least k·(1++ + +k/N) = k·HN/k k ·ln(N/k) Northeastern University/ GTE Laboratories
The characterization Theorem A set of coins solves thek-payment problem if and only if for alli N/k, the sum of coins of denomination ior less is at leastik. Northeastern University/ GTE Laboratories
k k 2 k 3 k 4 N k The allocation algorithm Starting from denomination 1, add the minimal number of coins so that the sum allocated with coins of denominations iis at least ki. Northeastern University/ GTE Laboratories
Exact analysis • Optimality: There is no way to allocate less coins for any N, k. • Upper bound: The number of coins allocated by the algorithm is never more than (k+1)HN/(k+1)(k+1) ln(N/(k+1)) (reduction, anyone?) Northeastern University/ GTE Laboratories
Restricted denominations: the problem • Not all denominations are available • Related problems: • Change making: dispense a single payment with least number of coins • postage stamp problem Northeastern University/ GTE Laboratories
Restricted denominations: the solution • Same basic idea: • Allocate coins while preserving the invariant • Use change making algorithm to allocate the remainder (dynamic programming always works) • Proof is more involved • No specific bounds on the number of coins Northeastern University/ GTE Laboratories