1
$\begingroup$

How to make a multiplication or division, the intermediate steps. The numbers can be rational - decimals? enter image description here

it seems the OP merely wants Mathematica to show him how to multiply and divide the way a kid in primary school would do it. That's a whole lot of digit carrying

This is the idea, for integers and decimals.

edit

enter image description here

$\endgroup$
  • 1
    $\begingroup$ @Oleksandr, it seems the OP merely wants Mathematica to show him how to multiply and divide the way a kid in primary school would do it. That's a whole lot of digit carrying… :o $\endgroup$ – J. M.'s technical difficulties Aug 2 '15 at 3:21
  • 2
    $\begingroup$ "it seems the OP merely wants Mathematica to show him how to multiply and divide the way a kid in primary school would do it. That's a whole lot of digit carrying" this is the idea, for integers and decimals $\endgroup$ – wally Aug 2 '15 at 3:48
  • 2
    $\begingroup$ @wally. Mathematica doesn't perform any intermediate steps such as you show when it does arithmetic. It could be programed to demonstrate the steps of school arithmetic, but would not be a trivial project. You might challenge followers of this site to produce such code. However, you will have to reword your question to make it clear that's what you want. Can't say whether or not you will get any takers. $\endgroup$ – m_goldberg Aug 2 '15 at 3:52
  • 2
    $\begingroup$ Related: Showing steps for TrigExpand. But I think this question is not related to an actual issue encountered while programming in Mathematica. Perhaps you should show what you've already tried. $\endgroup$ – Jens Aug 2 '15 at 3:56
  • $\begingroup$ Mathematica doesn't have this built in. You would have to program it from scratch. $\endgroup$ – Szabolcs Aug 2 '15 at 7:14
6
$\begingroup$

I feel like I should be prefacing this answer with three confessions, considering that this is an question. First, I had a hard time with the multiplication tables until I was nine years old. Second, even after I finally got the hang of multiplication, I was never a fan of multiplying from right-to-left; I preferred going left-to-right. (Arthur Benjamin seems to approve.) Finally, I confess I actually spent five six minutes writing this:

kidTimes[p_Integer?Positive, q_Integer?Positive] := Module[{cv, d, m, n},
   {m, n} = Through[{Max, Min}[{p, q}]]; d = IntegerLength[n] - 1;
   cv = ListConvolve[IntegerDigits[m], IntegerDigits[n], {1, -1}, 0, 
                     Times, Composition[Reverse, List]];
   Grid[ReplacePart[PadLeft[Append[{IntegerDigits[m], IntegerDigits[n]} ~Join~
        Table[ArrayPad[IntegerDigits[FromDigits[Diagonal[cv, k - d]]], {0, k}, ""],
              {k, 0, d}], IntegerDigits[m n]], Automatic, ""], {2, 1} -> "×"],
        Alignment -> {Right, Baseline},
        Dividers -> {False, {3 -> True, -2 -> True}}]]

how I NEVER did multiplication

(Writing this answer took longer than writing the routine from scratch.)

$\endgroup$
  • $\begingroup$ From scratch ... +1 $\endgroup$ – user9660 Aug 2 '15 at 15:58
  • $\begingroup$ just what I wanted, the case fails, the result runs right kidTimes[12345, 8945697] You can change the algorithm for division ":" $\endgroup$ – wally Aug 2 '15 at 23:29
  • $\begingroup$ I don't quite understand; are you saying kidTimes[12345, 8945697] does not give correct output? $\endgroup$ – J. M.'s technical difficulties Aug 3 '15 at 0:27
  • $\begingroup$ yes, not out aligned, look edition $\endgroup$ – wally Aug 3 '15 at 1:17
  • $\begingroup$ I won't be able to add in a fix for now, sorry. If you don't mind waiting… $\endgroup$ – J. M.'s technical difficulties Aug 3 '15 at 3:28
0
$\begingroup$

The following is too long for a comment and rather describes a strategy of searching for answers than giving an answer. It is certainly not a direct response to the question in favor of the question.

But it is also not a marketing response in favor of Wolfram Alpha.

Anyway, next https://mathematica.stackexchange.com/ and the Internet, I recommend the following pages for searches;

http://search.wolfram.com/ with the querry basic arithmetic,there are yet some good links, Results

http://demonstrations.wolfram.com/ with the querry multiplication,there are yet some good links, Results, in particular look at Long Multiplication

http://www.wolframalpha.com/pro/problem-generator/ from the Media:

Our online math practice problems offer hints and integrated Step-by-step solutions. Prefer pen and paper? Generate a printable worksheet for study sessions and quizzes.

And a really nice article Solving Basic Arithmetic Step by Step with Wolfram|Alpha

Have Fun!

$\endgroup$

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.