-1
$\begingroup$

If $A,B$ are whole numbers (0, 1, 2, 3...) how many solutions will you have for $$A+B=5$$ up to swapping the variables?

I know that these are the outcomes, and I see a pattern forming: $$0 + 5 = 5$$ $$1 + 4 = 5$$ $$2 + 3 = 5$$ But how do I find a formula that works for $$A+B = k$$ where $k$ is any whole number?

  • 0
    Let's say A is smaller or equal to B, then we know that A is smaller or equal $\frac K 2 $ but for any natural number n less or equal to $\frac K 2$ we have that $n+ (K-n) =K$. And those are thus all the solutions.2017-02-22
  • 0
    Are you considering ordered pairs or unordered pairs?2017-02-22

2 Answers 2

0

Using the Stars and Bars method you have $1$ bar and $k$ stars. Hence the number you are looking for is:

$\lceil\frac{1}{2}\cdot\binom{k-1}{2-1}\rceil+1=\lceil\frac{1}{2}(k-1)\rceil+1$

where $1/2$ is tu count up to swapping variables and the $1$ stands for the unique pair $(0,k)$ (up to swapping as you say of course).

  • 0
    Just wanted to note that your expression simplifies to ⌈(k+1)/2⌉2017-08-19
0

$$\begin{align} &0\to0+0\\ &1\to0+1\\ &2\to2+0,1+1\\ &3\to3+0,2+1\\ &4\to4+0,3+1,2+2\\ &5\to5+0,4+1,3+2\\ &6\to6+0,5+1,4+2,3+3\\ &7\to7+0,6+1,5+2,4+3\\ &\cdots\end{align}$$

Is it so difficult to see the pattern ?

  • 0
    I see the partern, Im looking for the formula if it asks A+B=k2017-02-22
  • 0
    @TonyConte: it's in front of your eyes, so what are you missing ?2017-02-22