Probability Expectation Problem for Collecting Trading Cards

A player collects trading cards with n distinct types. Each draw yields card type i with probability pi. Duplicate cards convert to coins, where k coins can be exchanged for one missing card. The process continues until all card types are collected. Compute the expected number of draws required. Input Format First line: n (card types) and k (co ...

Posted on Sat, 20 Jun 2026 16:29:23 +0000 by Bootsman123

Understanding Bloom Filters: Efficient Probabilistic Set Membership

Solving Cache Penetration Consider a typical product lookup service: public Product getProductById(Long id) { Product product = cache.get(id); if (product != null) { return product; } product = database.query(id); if (product != null) { cache.put(id, product); } return product; } If a product ID ...

Posted on Sun, 24 May 2026 19:43:02 +0000 by facets

Bitmask Dynamic Programming Techniques

Bitmask Dynamic Programming (Bitmask DP) is a technique used to solve problems where the state of a system can be represented by a small set of binary flags. By using an integer's bits to store boolean information—where each bit corresponds to a specific element's status—we can compactly represent and manipulate complex configurations. Core Con ...

Posted on Wed, 13 May 2026 20:34:02 +0000 by rhodry_korb