1

I'm working on a subset of problems for my university entrance exam that requires me to determine the number of possible integer $m$ such that function $f(x)$ involving constant $m$ has some $K$ extrema in interval $I$. The particular subset of problems I'm working on typically involves a subproblem that could be phrased as follows:

Determine a combination of $N$ numbers (order doesn't matter), given their sum $S$ and a small set of possible integer values $P$.

E.g.

$N = 3$

$S = 8$

$\text{P = {1, 2, 3}}$

The numbers must be $3$, $3$, $2$.

For the problems we are given in the exam, there is always a single such combination, so I could let my brain do a 'quick search' for a combination that works and be done with it. However, I'm interested in something more analytical and rigorous; I wondered if there is a systematic way to find such combinations, even all of them if multiple working combinations exist. Please advise!

Thanks!

Bill Dubuque
  • 272,048

1 Answers1

1

Note that (for example) changing $~S~$ to $~7~$ permits the two solutions of $~(3,3,1)~$ and $~(3,2,2).~$

So, in situations where you are guaranteed that there is exactly one solution, the wiggle room must be small.

That is, the sum must be close to either the absolute minimum sum possible with the elements or absolute maximum sum possible with the elements.

You will be able to tell at a glance whether $~S~$ is close to the minimum or maximum.

So, assume (for purposes of illustration) that $~S~$ is close to the maximum. Then, start by considering $~S'~$ equal to the maximum sum possible. Then consider what you need to do to wiggle the sum, by decreasing it in the amount $~(S' - S).$


For example, in the specified problem, $~S' = 9 \implies (S' - S) = 1.$

The only way to wiggle the sum by decreasing it in the amount $~(S' - S) = 1,~$ is by changing on of the $~3$'s to a $~2.$


In the situation where there may or may not be multiple solutions, the situation is much more complicated. My first step would be to consider whether $~S~$ was close to the minimum, or close to the maximum. Again, for illustrative purposes, temporarily assume that $~S~$ is close to the maximum, and that there may or may not be more than one solution.

The procedure is roughly the same as in the first part of the answer. Set $~S'~$ equal to the maximum sum possible, compute the wiggle of $~(S' - S),~$ and then determine all of the possible ways of achieving such a wiggle.


With the more general problem, there are two possible complications. I will address each complication in its own section. The first complication is that $~S~$ may be nowhere near the minimum or maximum sum possible.

For example, consider the problem of
$N = 17, ~P = \{1,2,3,\cdots,50\}, ~S = 400.$

In effect, you want the number of solutions to

  • $~x_1 + \cdots + x_{17} = 400.$

  • $~x_1, \cdots, x_{17} \in \Bbb{Z^+}.$

  • $~x_1, \cdots, x_{17} \leq 51.$

This problem can be solved either by generating functions, which I am ignorant of, or by [Stars and Bars + Inclusion-Exclusion]. For a blueprint of how to attack such problems via the second approach, SB+IE, see this answer.

Note that here, I am taking an unauthorized license, by assuming that the order of the values assigned to the variables is deemed relevant. That is, a solution where $~x_1 = 1, ~x_2 = 2,~$ is deemed distinct from a solution where $~x_1 = 2, ~x_2 = 1.~$

If this assumption is false, then the problem involves Partitioning a number into a fixed set of terms.


In all of the previous problems, the elements in $~P~$ were in arithmetic sequence, which facilitates an analytical approach. What if the elements are not in sequence?

For instance, suppose that

  • $~N = 100.$

  • $S = 3000.$

  • $P =~$ the set of all prime numbers.

How many solutions are there?

I consider this last problem a nightmare, and I see no analytical approach to the problem.

user2661923
  • 35,619
  • 3
  • 17
  • 39
  • Hi, thank you so much for the detailed response! I peeked at the links you shared but the material seemed outside of my current mathematical knowledge. I'll be sure to check them out again when I get to the relevant material. Thanks again and I love your method of considering the possibilities of the max or the min 'shrinking' to the required sum! – ten_to_tenth Jan 21 '24 at 08:50