Stalagmite Function
Objective: Genetic Algorithm:-This is based on natural selection process in biology, in this process, the ga randomly selects a individual from the current population and uses them to create children(output).Over successive generation the population evolve towards a optimal solution. Step 1: x and y values are generated using…