  We propose a framework for analyzing classical sampling strategies for
estimating the Hamming weight of a large string, when applied to a multi-qubit
quantum system instead. The framework shows how to interpret such a strategy
and how to define its accuracy when applied to a quantum system. Furthermore,
we show how the accuracy of any strategy relates to its accuracy in its
classical usage, which is well understood for the important examples. We show
the usefulness of our framework by using it to obtain new and simple security
proofs for the following quantum-cryptographic schemes: quantum
oblivious-transfer from bit-commitment, and BB84 quantum-key-distribution.
