Exercise 3: Why 15,000 Users Can't All Get Unique 4-Digit PINs — Possible Solution ==================================================================== IDENTIFYING THE DOMAIN AND CODOMAIN ------------------------------ The function being defined assigns a PIN to each user: domain A = the set of 15,000 users, codomain B = the set of possible 4-digit PINs, which has exactly 10,000 possible values (0000 through 9999). APPLYING THIS CHAPTER'S OWN CARDINALITY PRINCIPLE ------------------------------ Per this chapter, "if |A| > |B|, no injective function from A to B can exist at all." Here, |A| = 15,000 (the users) and |B| = 10,000 (the possible PINs). Since 15,000 > 10,000, this chapter's own principle applies directly: no possible assignment of PINs to users - no matter how cleverly designed - can ever be injective. WHY NO CLEVER ASSIGNMENT SCHEME CAN AVOID THIS ------------------------------ This isn't a limitation of any particular assignment algorithm - it's a direct mathematical consequence of the relative sizes of the two sets involved. Each of the 15,000 users needs to be assigned one of only 10,000 possible values. Even in the best possible case, assigning every distinct PIN to a different user first exhausts all 10,000 PINs after only 10,000 of the 15,000 users have been assigned one - leaving 5,000 users with no unused PIN left. Every one of those remaining 5,000 users must necessarily reuse a PIN some earlier user already has. THE MINIMUM GUARANTEED AMOUNT OF SHARING ------------------------------ Since 15,000 users must be distributed across only 10,000 possible PIN values, at least one PIN value must be shared by at least two users - this specific consequence is what Chapter 9's own pigeonhole principle formalizes precisely, but the reasoning here already follows directly from this chapter's own cardinality fact about injective functions. WHY THIS WORKS AS AN ANSWER ------------------------------ It identifies the domain and codomain explicitly, applies this chapter's own stated cardinality principle by comparing their sizes, and explains concretely - through the "PINs run out at 10,000 users" reasoning - why no possible assignment scheme could ever avoid at least some users sharing a PIN.