In the course of an experiment, two gases X and Y were produced. X turned…