(do not solve the question. i am only asking how to write theprogram!)

Consider a triangle and a point chosen within the triangleaccording to the uniform probability law. Let X be the distancefrom the point to the base of the triangle. Given the height of thetriangle, find the CDF and the PDF of X.

Write a program in either python or java to simulate the aboveproblem and display the output in a graphical form, with thefollowing simplifications:

The triangle has one corner at the origin, one at (1,0), and oneat (x,0), repeating the program for x = 0, 1/2,1.