-1

"A little pie costs 23, and a cake costs 49. Is it possible to reach 500$ selling both of the products?"

My attempt:

$\\23x + 49y = 500 \\23x + 49y \equiv 500 \pmod{23} \\0x + 3y \equiv 17 \pmod{23} \\3y \equiv 17 \pmod{23} \\y \equiv 21 \pmod{23}\\23x+49(21+23k)=500 \\ \text{then:}\\\\x=-23-49k \\y=21+23k$

I have already tested some values and it seems to work well, the thing is:

Is there a way to know if I can reach 500 by only using positive integers? If yes, then how? I want to do so because I guess he can't sell negative pies or negative cakes, If I am wrong, please let me any hints, thanks in advance.

Bill Dubuque
  • 272,048
  • $$\begin{align} 500, &= 49(21) + 23(-21)\ {\rm i.e.}\ \ \ \ k, &= ,\ m, X\ \ +\ \ n, Y \end{align}\qquad\qquad$$

    is normalized, i.e. $0\le X < n,,$ so by $,Y< 0,$ the equation $,500 = 49X+ 23Y,$ has no integer roots $,X,Y\ge 0,,$ by the Lemma in the linked dupe. See the Linked question there for many answers on this FAQ.

    – Bill Dubuque Nov 12 '21 at 09:27

2 Answers2

0

you can write

$x=\frac {500-49y}{23}=21-2y+\frac {17-3y}{23}$,

Since $49y\leq500,y\leq10$,

therefore $-13\leq17-3y\leq17$,

I believe you can easily get the desired result.

0

Alternative approach:

$x=−23 −49k$.
$y=21+23k$.

Assuming that the above work is accurate, and that it is desired that both $x$ and $y$ be non-negative and that $k$ must be an integer:

  • The first equation above requires that $k < 0$, else $x < 0$.

  • The second equation requires that $k \geq 0$, else $y < 0$.

Therefore, there is no integer value of $k$ that will make both $x$ and $y$ non-negative.

user2661923
  • 35,619
  • 3
  • 17
  • 39
  • This is a special case of the Lemma in the linked dupe. Please strive not to add more (dupe) answers to dupes of FAQs, cf. recent site policy announcement here. – Bill Dubuque Nov 12 '21 at 09:28