# How to solve these optimization problems?

Hey I seem to have trouble solving optimization problems and I’m stuck on these two. I was wondering if anyone can help point me to the right direction. Also, are any resources or advice to help improve optimization problems in general?

Arnold has n items arranged in a row. Each items has one of 100 different ids (0 to 99). He wants to mix all these items together. At each step, he mixes two items that stand next to each other, and puts the resulting item in their place. When mixing two items a and b, the resulting item will have id≡(a+b)(modn)id\equiv (a+b)\pmod n st n = 100. Also, the amount of broken code generated when mixing two items of a and b is a*ba*b. Find out what is the minimum amount of error that Arnold can get when mixing all the items together.

Note: I didn’t know if this was supposed to be posted on math or cs se. I posted it here since I couldn’t find a way to even solve it with a mathematical approach and I thought it was more appropriate here but if it doesn’t belong here, just tell me and I will remove it.

=================

Hi, welcome to Math.SE. Please note that this is a MathJax-enabled site; use the facility. For a quick info, check this meta Math.SE post.
– MAFIA36790
2 days ago

np thanks. will fix
– diyi
2 days ago

=================

=================