Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 854407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:55:09+00:00 2026-05-15T07:55:09+00:00

Solve for s , and t 1 … t n that minimizes the following

  • 0

Solve for s, and t1…tn that minimizes the following summation:

Σnk = 1 (1 – min(s·tk,Ck)/max(s·tk,Ck)),

where

C1…Cn > 1,
s > 0,
t1…tn ∈ ℤ+


edit to clarify to problem description:

“how fast of an algorithm you require.” Not super fast (But not multiple seconds). n will be around 5-10 or so.

As far as the actual problem, I have a number of “elements” of different sizes on a “page” and this page needs to be translated to a format in which there is a maximum base size for an element of X, and the base size of an element has to be an integer. However in the new format any element can be scaled up by a single scaling factor set for the page.

So C1…Cn were the sizes of the elements on the original page. t1…tn are the new integer sizes in the new page format. (And t1…tn need to be less than X.) The scaling factor for the new page format is s.


More:

As far as what I’ve done previously, I find the largest element on the original page, and if its smaller than X, I just use the existing element sizes on the new page, but rounding each one to an integer. However, If the largest element on the original page is greater than X, I divide its size by X to get the scaling factor s for the new page, and divide C1…Cn by s to get t1…tn. But this results in size discrepancies of something like 1-3% on average for every element on the new page but the largest. Not really all that noticeable, but I’m a perfectionist.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:55:10+00:00Added an answer on May 15, 2026 at 7:55 am

    You should read on linear programming with integer unknowns as well.
    Even though this is not linear programming it might give you an idea on what to look for.

    Also you might head over to https://mathoverflow.net/ to get some help remodelling the problem (you have an optimization problem on an integer domain with discontinuities in goal function and my math is a bit rusty to place it properly; check combinatorial optimization as well)

    (for the right solution jump to EDIT4 below)
    EDIT:
    Regarding linearity

    Looking for maximum of

    Σnk = 1 (1 – min(s·tk,Ck)/max(s·tk,Ck))


    might be the same as looking at the maximum for

    Σnk = 1 (max(s·tk,Ck) – min(s·tk,Ck))

    providing that

    Σnk = 1 max(s·tk,Ck) > 0

    (which is always ?true? given your conditions)

    And term

    Σnk = 1 (max(s·tk,Ck) – min(s·tk,Ck))

    can be written as

    Σnk = 1 Abs(s·tk – Ck)

    which, if the question mark above hold gives the following

    • maximize s and all tk
    • minimize all Ck

    So all C = 1, and all t and s → ∞ for which your original expression approaches n.

    Ok, so originally I was wrong with my suggestion, because I assumed a question would not degenerate into trivial case, which actually it quite obviously does.

    EDIT2:
    My math is rusty, the procedure above is not correct (first step), but the conclusion/solution seems to validate so I will not correct (it gets a bit complicated)

    EDIT3 (Ck are constants and other corrections):

    Maybe I should clean up the answer, I believe the following reasoning is enough as a solution:

    The fact that Ck are constant and not equal 1 does not matter. To maximize original expression

    Σnk = 1 (1 – min(s·tk,Ck)/max(s·tk,Ck))

    you should minimize

    Σnk = 1 min(s·tk,Ck)/max(s·tk,Ck)

    since domain of everything is positive to make this ratio minimal you have to make numerator as small as possible and denominator as big as possible.

    The ratio is zero if

    • tk is 0 for all k ⇒ min(0, Ck)/max(0, Ck) = 0/Ck = 0

    It also approaches zero if

    • s approaches zero (similarly as above, only it is the limit that is equal 0)
    • s approaches infinity ⇒ min(∞, Ck)/max(∞, Ck) = Ck/∞ = 0
      (the above equalities should have used limit notation…)
    • tk approaches infinity for all k

    (each condition is enough on its own and represents the solution, when combining them don’t let s approach 0 while tk approach infinity or vice versa; in such case it matters which one approaches it faster)

    EDIT4: (actual solution)
    Well basically all of the above is giving answer to a wrong question, because I was looking for maximum of the original goal function, not the minimum.

    As for minimum it is a bit more interesting, the minimum is reached if each term

    min(s·tk,Ck)/max(s·tk,Ck) = 1

    This is the maximum of this term given the domain of the parameters. If we assume (for now) that Ck is integer then the solution can be found for

    s = 1
    tk=Ck

    However Ck is not integer in general case, so we need to find s for which Ck/s is integer.

    If we can write Ck as

    Nk/Dk where N, D ∈ ℤ+ (in another words if Ck is rational)

    then a solution can be

    s = 1/∏nk = 1Dk
    tk = Nk/Dk · ∏nk = 1Dk
    (which is ∈ ℤ+)

    Note:
    Instead of choosing s to be a product of all denominators it could be set to biggest common denominator, and then tk can be calculated appropriately.

    Note2:
    Plotting diagrams of the functions in question helped me catch my error of misreading the question (realizing that minimum is much more interesting). Also I realized that the functions are continuous (but not smooth, so derivations are discontinuous).

    Note3:
    The above solution works for rational numbers, but I imagine that irrational numbers would not make the solution useless as decimal or other rational representations of irrational numbers would give an approximate solution proportionally close to real solution as the representation is close to actual value of irrational number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to solve the following problem: I have a download button that when
I'm trying to solve the 3n+1 problem and I have a for loop that
I would like to solve the following problem using constraints but i actually don't
I need to solve a computational problem that boils down to searching for reciprocally-nearest
I need to solve the following problem. //pseudo algorithm you have four elements: elm1,
I'm looking to solve with CSS a problem that I found far trickier than
I am trying to solve this exponentiation problem . Here is the code that
I am trying to solve the following problem. Lets say you have the the
To solve some problem I need to compute a variant of the pascal's triangle
In trying to solve the ajax back button problem I have found the Really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.