answersLogoWhite

0

AllQ&AStudy Guides
Best answer

There are (n2 - n) / 2 moves required.

I am not aware that "stampled" is a word beyond a cross between stampede and trample, but I believe you wish to reverse the order of numbers from 1 to n where only two consecutive numbers can be swapped per step.

This process will show a pattern of triangular numbers. For example:

Let us suppose there are 3 numbers 1,2,3: To move the last (highest) number to the first place requires 2 steps. The second highest number is now in the last place. To move it to the second place requires 1 step. Finished. Total = 3 steps.

Or:

If there are 4 numbers, i.e. 1,2,3,4:

3 steps + 2 steps + 1 step = 6 steps total. We know it is only 3 steps more than the last example because once we have moved the 4 to the first place we then simply have to do the above again (rearrange the 1,2,3, to 3,2,1).

So you can see that the number of steps are all triangular numbers.

A triangular number is calculated by n(n+1) / 2. So we can use this formula, but we need to alter it because the number of steps are for the previous triangular number. E.g. Where there are 4 numbers we have to do 1+2+3 steps to reorder it (see above).

Therefore if we make our formula (n - 1) n / 2 = (n2 - n) / 2 then this will work.

This answer is:
Related answers

There are (n2 - n) / 2 moves required.

I am not aware that "stampled" is a word beyond a cross between stampede and trample, but I believe you wish to reverse the order of numbers from 1 to n where only two consecutive numbers can be swapped per step.

This process will show a pattern of triangular numbers. For example:

Let us suppose there are 3 numbers 1,2,3: To move the last (highest) number to the first place requires 2 steps. The second highest number is now in the last place. To move it to the second place requires 1 step. Finished. Total = 3 steps.

Or:

If there are 4 numbers, i.e. 1,2,3,4:

3 steps + 2 steps + 1 step = 6 steps total. We know it is only 3 steps more than the last example because once we have moved the 4 to the first place we then simply have to do the above again (rearrange the 1,2,3, to 3,2,1).

So you can see that the number of steps are all triangular numbers.

A triangular number is calculated by n(n+1) / 2. So we can use this formula, but we need to alter it because the number of steps are for the previous triangular number. E.g. Where there are 4 numbers we have to do 1+2+3 steps to reorder it (see above).

Therefore if we make our formula (n - 1) n / 2 = (n2 - n) / 2 then this will work.

View page

1/35 or 2.86%

View page

its false

View page

well he is telling his friends either because he is bragging on him self and thinks he is a big shot becuase a pretty girl like you likes him or he is making fun of you. or maybe he likes talking about you because he likes you but your maybe younger then him and scared that if he were to date you he would be the one to be mocked. either way from girl to girl he aint worth the time. but if you truly like him then if it was me i would name off everything i like about him from his eyes to his charm or his voice and then i would pray and ask the lord to do what he would want to happen!

View page

Only eighteen? Oh, no. There are actually about 6500 languages in the modern world.

View page
Featured study guide

Which of these is most closely associated with the Federal Reserve System

Which of these was authorized to loan money to private corporations railroads industries and banks

What did Hoover think would result if financial assistance was given directly to the people

True or false The Great Depression although felt worldwide during the 1930s had no effect on the Japanese economy

➑️
See all cards
5.0
β˜†β˜…β˜†β˜…β˜†β˜…β˜†β˜…β˜†β˜…
1 Review
More study guides
β˜†β˜…β˜†β˜…β˜†β˜…β˜†β˜…β˜†β˜…
No Reviews

β˜†β˜…β˜†β˜…β˜†β˜…β˜†β˜…β˜†β˜…
No Reviews
Search results