Persistence Diagram Cardinality And Its Applications