Numbers 1,2,3,…n(each integer from 1 to n once) are written on a board. In one operation you can erase any two numbers a and b from the board and write one integer (a+b)/2 rounded up instead. What is the minimum number which one can get left after carrying out the operation n-1 times for a given n>=2 ?
My progress Suppose we have k numbers that is from 1 to k , now we know that when we do average and round it up to closest integer it will be lying between the chosen a and b integers (inclusive of both). so we need to make sure that we always get the average number closest to a ,one way would be taking k-1 and k and averaging repeating it again . this probably gives the number as 2 . But what is the proof that this is the optimal strategy which gives the minimum number of 2 always ? (expect a algebraic solution using inequalities or maybe some bounds ) i am not able to think how to show that since initial numbers we chose can be any .
Ross gave a clue like maybe prove that at each step you decrease the sum of all the numbers as much as possible so your greedy algorithm must be optimal. using that i believe i got it maybe:
Consider the sum 1+2+3+4+5+6... +n; at each step we try to decrease the sum as much as possible so we need to take some numbers from last . as intial will not cause much decrease , hence we will consider the n-1 and n, that will decrease the sum by n-1,similarily we will consider next step of maximum decrease by taking the last two again in the sum: that is n-2,n, it will cause decrease of n-1, next n-3,n-1 and the post continues . so since our algo is making the max decrease at each time . thats why it should be the optimal .