  We show that the computation of formation probabilities (FP) in the
configuration basis and the full counting statistics (FCS) of observables in
the quadratic fermionic Hamiltonians are equivalent to the calculation of
emptiness formation probability (EFP) in the Hamiltonian with a defect. In
particular, we first show that the FP of finding a particular configuration in
the ground state is equivalent to the EFP of the ground state of the quadratic
Hamiltonian with a defect. Then, we show that the probability of finding a
particular value for any quadratic observable is equivalent to a FP problem and
ultimately leads to the calculation of EFP in the ground state of a Hamiltonian
with a defect. We provide new exact determinant formulas for the FP in the
generic quadratic fermionic Hamiltonians. As applications of our formalism we
study the statistics of the number of particles and kinks. Our conclusions can
be extended also to the quantum spin chains that can be mapped to the free
fermions via Jordan-Wigner (J-W) transformation. In particular, we provide an
exact solution to the problem of the transverse field XY chain with a staggered
line defect. We also study the distribution of magnetization and kinks in the
transverse field XY chain and show how the dual nature of these quantities
manifest itself in the distributions.
