Answer:
import java.util.*;
class ProbabilityOfRollingThreeDice
{
public static void main(String[] args)
{
Random rnd = new Random();
System.out.print("Enter a random seed: ");
long seed = new Scanner(System.in).nextLong();
rnd.setSeed(seed);
for(int i = 3; i <= 18; i++)
{
int count = 0;
for(int j = 0; j < 1000; j++)
{
int roll1 = rnd.nextInt(6) + 1;
int roll2 = rnd.nextInt(6) + 1;
int roll3 = rnd.nextInt(6) + 1;
int sum = roll1 + roll2 + roll3;
if(sum == i)
count++;
}
System.out.println("The value " + i + " occurred " + count + " times.");
}
}
}