Question

In: Computer Science

In math class, a student has written down a sequence of 16 numbers on the blackboard....

In math class, a student has written down a sequence of 16 numbers on the blackboard. Below each number, a second student writes down how many times that number occurs in the sequence. This results in a second sequence of 16 numbers. Below each number of the second sequence, a third student writes down how many times that number occurs in the second sequence. This results in a third sequence of numbers. In the same way, a fourth, fifth, sixth, and seventh student each construct a sequence from the previous one. Afterward, it turns out that the first six sequences are all different. The seventh sequence, however, turns out to be equal to the sixth sequence. Give one sequence that could have been the sequence written down by the first student. Explain which solution strategy or algorithm you have used.

Solutions

Expert Solution

Looking at the problem the best way is to go from bottom to top. In this case from 7th sequence to 1st sequence.

Now from the last line we understand that 7th and 6th sequence are exactly same.

Assume 6th sequence is also all 9s, 7th becomes all 16.

6th: 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9

7th: 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

Thinking around this line, it is only possible when the 6th sequence is all 16. Only then the 7th sequence will be all 16 as there are 16 16's in the previous sequence.

1: ?

2: ?

3: ?

4: ?

5: ?

6: 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

7: 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

Now moving to previous sequence i.e. 5th. Looking at the 6th sequence, it seems that all numbers in 5th sequence are same. It can be anything but as a sequence is not to be repeated in the first 4 ones, assuming 5th sequence is all n(n<>16)

So we have:

1: ?

2: ?

3: ?

4: ?

5: n n n n n n n n n n n n n n n n (n<>16)

6: 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

7: 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

Going for 4th sequence; we see 5th sequence consists all n. So now when there seems no option, we assume again. Assuming n = 9; it shows something like this:

5: 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9

6: 16 ...16... 16

Looks correct. But all n=9 is not possible. If n = 9 that means 4th sequence can only be of 9 elements or of 18 elements. But we have 16. Thinking around it again, we see n = 16 fits perfect again! But 5th sequence cannot be same as 6th sequence.

If we think logically, n can be anything that is a divisor of 16. So n can be 1,2,4,8.

trying to fit in 4, we fail at a previous step as below. 4th sequence goes wrong.

2 2 2 2 4 4 4 4 6 6 6 6 8 8 8 8
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

But if we go for n =8, that might fit lets read along to find out.

Current sequence state:

1 ?
2 ?
3 ?
4 ?
5 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
6 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
7 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

16

So as stated earlier in case of 9, We see 2 8th are possible

Hence.

Sequences we have is

1 ?
2 ?
3 ?
4 m m m m m m m m n n n n n n n n
5 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
6 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
7 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

Now, we follow similar process, m,n <=8 divisor of 8, but m <>n as then it would be all 16 in next sequence.

We keep n as 8 again and reduce n to 4

1 ?
2 ?
3 m m m m n n n n o o o o o o o o
4 4 4 4 4 4 4 4 4 8 8 8 8 8 8 8 8
5 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
6 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
7 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

So again, m,n,o<4 and divisor of 4. but m<>n or else any of the next sequence will be repeated.

o < 8 and divisor of 8.

Again applying same logic,

we have below as the second sequence:

1 ?
2 a a b b c c c c d d d d d d d d
3 2 2 2 2 4 4 4 4 8 8 8 8 8 8 8 8
4 4 4 4 4 4 4 4 4 8 8 8 8 8 8 8 8
5 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
6 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
7 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

now d in (1,2,4,8) c in (1,2,4) ;b in (1,2); a in (1)

if a = 1, b cannot be 1 hence b is 2. So c cannot be in 1,2 so c = 4 and hence d cannot be 1,2,4 hence d = 8

Final sequence is :

1 ?
2 1 1 2 2 4 4 4 4 8 8 8 8 8 8 8 8
3 2 2 2 2 4 4 4 4 8 8 8 8 8 8 8 8
4 4 4 4 4 4 4 4 4 8 8 8 8 8 8 8 8
5 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
6 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
7 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

So Sequence 1 can include any numbers irrespective of any clause which has

first 2 numbers different.

next 2 numbers same.

next 4 numbers same.

next 8 numbers same.

So sample sequence is

a,b,c,c,d,d,d,d,e,e,e,e,e,e,e,e.

only condition being a<>b<>c<>d<>e

Hope this helped!

Thank you! Best of Luck!


Related Solutions

In math class, a student has written down a sequence of 16 numbers on the blackboard....
In math class, a student has written down a sequence of 16 numbers on the blackboard. Below each number, a second student writes down how many times that number occurs in the se‐ quence. This results in a second sequence of 16 numbers. Below each number of the second se‐ quence, a third student writes down how many times that number occurs in the second se‐ quence. This results in a third sequence of numbers. In the same way, a...
In math class, a student has written down a sequence of 16 numbers on the blackboard....
In math class, a student has written down a sequence of 16 numbers on the blackboard. Below each number, a second student writes down how many times that number occurs in the sequence.  This results in the second sequence of 16 numbers. Below each number of the second sequence, a third student writes down how many times that number occurs in the second sequence. This results in the third sequence of numbers. In the same way, a fourth, fifth, sixth, and...
There are 16 students in a class. Each student has either a bicycle or a tricycle. There are exactly 37 wheels altogether.
There are 16 students in a class. Each student has either a bicycle or a      tricycle. There are exactly 37 wheels altogether. How many bicycles do the students have?
The class Person, uploaded on Blackboard with Lab 5, only has methods to set and print...
The class Person, uploaded on Blackboard with Lab 5, only has methods to set and print the name of a person. Redefine the class Person to include the following operations: Set the last name only Set the first name only Set the middle name Check whether a given last name is the same as the last name of this person Check whether a give first name is the same as the first name of this person Check whether a given...
Treena is a personable student in Mr. Jordan's math class. Mr. Jordan can see that Treena...
Treena is a personable student in Mr. Jordan's math class. Mr. Jordan can see that Treena is popular with her peers. He regularly sees her conversing animatedly with her friends in the cafeteria and before and after school. She does well in class also. Her homework is always on time and is usually well done. Her scores on tests generally range from 85 to 100%. She regularly volunteers to work problems on the board or to answer questions in class....
A Java question. You are given a Student class. A Student has a name and an...
A Java question. You are given a Student class. A Student has a name and an ArrayList of grades (Doubles) as instance variables. Write a class named Classroom which manages Student objects. You will provide the following: 1. public Classroom() a no-argument constructor. 2. public void add(Student s) adds the student to this Classroom (to an ArrayList 3. public String hasAverageGreaterThan(double target) gets the name of the first student in the Classroom who has an average greater than the target...
Write a class encapsulating the concept of a Student, assuming that the Student has the following...
Write a class encapsulating the concept of a Student, assuming that the Student has the following attributes: the name of the student, the average of the student, and the student’s GPA. Include a default constructor, an overloaded constructor, the accessors and mutators, and methods toString() and equals(). Also include a method returning the letter grade base on the following range for the average: Average Range Letter Grade 90-100 A 85-89   B+ 80-84 B 75-79 C+ 70-74 C 65-69 D+ 60-64...
Write a class encapsulating the concept of a Student, assuming that a student has the following...
Write a class encapsulating the concept of a Student, assuming that a student has the following attributes: last name, first name, id, array of grades. Include a constructor, the accessors and mutators, and method toString. Also code the following methods: one returning the GPA using the array of grades (assuming each grade represents a course grade and all courses have the same number of credit hours) and a method to add a course grade to the array of grades (this...
If the value of an asset that has been written down later increases, to what extent...
If the value of an asset that has been written down later increases, to what extent may the related gain be recognized? None of the gain may be recognized. Up to the amount of the original loss. Up to the fair market value of the asset. No remeasurements may be recognized. Inputs to income models include which of the following? adjusting cash flows and the discount rate in the same calculation actual cash flows time value of money using a...
Intercultural Communication. A college professor has a new student from China in the class. The student...
Intercultural Communication. A college professor has a new student from China in the class. The student does not speak English fluently. Name and discuss three cultural factors that might influence classroom interaction
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT