0
$\begingroup$

I found the following statement from the textbook accompanying MIT's course Mathematics for Computer Science. The pdf can be found here, on page 8.

I can't see how the first implies the second, but I don't know what to learn in order to better understand this. Can anyone point me in the right direction?

$a = q(sa + tb) + r$ so $r = (1-qs)a + (-qt)b$

I can see that the terms are the same, but where does the 1 come from here? My understanding of algebra is fairly limited, but here I don't even know where to start. Any help is appreciated!

$\endgroup$
  • 2
    $\begingroup$ It's actually just straightforward algebra and rearrangement of the expression/ solving for r, also the term is $(1-qs)a$ $\endgroup$ – Triatticus Dec 14 '17 at 21:37
  • 2
    $\begingroup$ You do it step by step. First, expand $a = q(sa + tb) + r$ into $a = qsa + qtb + r$. Then you bring those $qsa, ptb$ to the left. So we have $a - qsa - qtb = r$. Finally, factorize $a$ to get $r = a(1 - qs) - qtb$ $\endgroup$ – Alex Vong Dec 14 '17 at 21:38
  • $\begingroup$ If you have more problems like this, I think you need to review parts of precalculus. $\endgroup$ – Stephen Meskin Dec 14 '17 at 21:48
2
$\begingroup$

Expand $$ a = qsa + qtb + r $$

Rearrange terms $$ r = a - qs a - qtb $$

Factor $$ r = (1-qs)a - qtb $$

This will sound mean, but the answer to "what you need to learn" is "basic algebra techniques"

$\endgroup$
  • $\begingroup$ Thanks! Looking at it like this, it is quite clear. Each step makes sense to me individually, but perhaps improving my familiarity with these techniques would make it easier to clearly see multiple jumps. No need to worry about sounding mean, I did say that my understanding is limited, and that I wanted to be pointed in the direction of what to learn. $\endgroup$ – OliverRadini Dec 14 '17 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.