Question: Please write code in java language. Thank you A statistician is studying sequences of numbers obtained by repeatedly tossing a six-sided number cube. On each
A statistician is studying sequences of numbers obtained by repeatedly tossing a six-sided number cube. On each side of the number cube is a single number in the range of 1 to 6, inclusive, and no number is repeated on the cube. The statistician is particularly interested in runs of numbers. A run occurs when two or more consecutive tosses of the cube produce the same value. For example, in the following sequence of cube tosses, there are runs starting at positions 1, 6, 12, and 14. 0 2 3 4 5 6 78 910 11 12 13 14 15 16 17 Write a method that takes a number of tosses as a parameter and returns an array of values produced by tossing a cube the given number of times Write a method that takes as its parameter an array of integer values representing series of cube tosses, and returns the starting index in the array of a run of maximum size. (If the array contains more than one run of maximum size, the method may return the index of any starting value.) If there are no runs of any value then the method should return-1. Write a program that demonstrates your methods by reading an array size, executing the above methods, and displaying the results
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
