Equations are obtained for the quantum distribution functions over discrete states in systems of non-interacting fermions and bosons with an arbitrary, including small, number of particles. The case of systems with two levels is considered in detail. The temperature dependences of entropy, heat capacities and pressure in two-level Fermi and Bose systems are calculated for various multiplicities of degeneracy of levels.