Question: write a brute force algorithm in java that calculates how many combinatinos of d dice rolls can produce a sum >= the threshold n. example:

write a brute force algorithm in java that calculates how many combinatinos of d dice rolls can produce a sum >= the threshold n.

example: d = 2 n = 10 there are 6 dice rolls that equal or exceed the threshold: 4,6 6,4 5,5 6,6 5,6 6,5

The program should not output every combination, just the total number of possible combinations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!