According to equipartition theorem each degree of freedom contributes energy t…