Write a java program that simulates thousands of games and thencalculate the probabilities from the simulation results.Specifically in the game, throw two dice, the possible summationsof the results are: 2, 3, ..., 12. You need to use arrays to countthe occurrence and store the probabilities of all possiblesummations. Try to simulate rolling two dice 100, 1000, 10,0000times, or more if needed. Choose one simulation number so that theprobabilities you calculated is within 1% absolute error comparedwith the theoretical probability. For example, the theoreticalprobability for summation result 2 is approximately 2.78%, thenyour calculated probability based on simulations should be between2.28% and 3.28%. The following is required:
• Use an array of ints of length 11 to keep count of thedifference occurrences. When an int or double array is created, itsvalues are initialized to 0 by default.
• In the simulation loop, throw the two dice, add the values,and then increase the corresponding array element by 1.
• Turn the occurrence counts into probabilities after thesimulation loop is done.