×

# how to make N numbers EQUAL by adding only 1,2 and 5

How to make N numbers equal by addin only 1, 2 or 5? You can choose as many of N numbers and add 1, 2 or 5? Result is the minimum number of addition operation?

Example:; 2, 2, 3, 7 are numbers......... then adding 1 to all exept third will give 3, 3, 3, 8........ now add 5 to all exept last give 8 8 8 8......... so for this min number is 2

Pls suggest a solution strategy, which we can apply to any set of numbers

Note by Akash Goyal
4 years, 7 months ago

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$...$$ or $...$ to ensure proper formatting.
2 \times 3 $$2 \times 3$$
2^{34} $$2^{34}$$
a_{i-1} $$a_{i-1}$$
\frac{2}{3} $$\frac{2}{3}$$
\sqrt{2} $$\sqrt{2}$$
\sum_{i=1}^3 $$\sum_{i=1}^3$$
\sin \theta $$\sin \theta$$
\boxed{123} $$\boxed{123}$$

Sort by:

I think i got it......

1). find 1st minimum & 2nd minimum

2). calculate difference. between 1st & 2nd min

3).add the difference to all elements, except the 2nd minimum.

Repeat this till all elements become equal.

Example: 2,2,3,7

2nd min-1st min = 2-1 = 1

so, 3,3,3,8

2nd min-1st min = 8-3 = 5

so, 8,8,8,8

total steps=2

If the difference is not 1,2,5, then it sud be arranged in form of addition of 1,2,5.

example: 10=5+5, 9=5+2+2

- 4 years, 7 months ago

$$0,1,2,3$$.

The best solution uses 2 additions:

• Add 1 to $$0,2$$, giving $$1,1,3,3$$
• Add 2 to $$1,1$$, giving $$3,3,3,3$$

• Add 1 to $$0,2,3$$, giving $$1,1,3,4$$
• Add 2 to $$1,1,4$$, giving $$3,3,3,6$$
• Add 2 to $$3,3,3$$, giving $$5,5,5,6$$
• Add 1 to $$5,5,5$$, giving $$6,6,6,6$$

I believe this is a fairly difficult problem. My best strategy at the moment is somewhere like this:

Determine the differences between each number and the maximum. Express the differences in as few terms as possible, and clear them up as efficiently as possible. This means applying as many 5s as possible to clear the maximum difference, then applying at most two 2s and one 1 for the remainders ($$0 = 0, 1 = 1, 2 = 2, 3 = 2+1, 4 = 2+2$$; in all cases, only two 2s and one 1 are required).

I claim the above is at most 2 away from the best solution. I'm thinking of a better solution (or otherwise a rigorous proof that the above strategy is actually the best solution).

- 4 years, 7 months ago