Two elements, X and Y are in the same group on the periodic table because…