public class Solution { public static void main(String[] args) { long positiveSide = 0; long negativeSide = 0; int side; for(long i = 0; i < 1000000; i++) { side = (int)(Math.random() * 2); if(side == 1) positiveSide++; else negativeSide++; } System.…