Home▸Algorithms & AI▸Karatsuba Multiplication: Recursion Tree, Work Area and Cost Ratio (2D)

Karatsuba Multiplication: Recursion Tree, Work Area and Cost Ratio (2D)

The same recursion tree drawn level by level with brick sprites, two squares whose areas are the schoolbook and Karatsuba work, and the cost-ratio curve with the crossover marked. Same shared counting model and numerical checks as the 3D version.

Algorithms & AI2DModerate60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
Karatsuba Multiplication: Recursion Tree, Work Area and Cost Ratio (2D) ↗ Open standalone

Multiply two large random numbers digit by digit with Karatsuba's trick of three half-size products instead of four. Set the number of digits, the cutoff where the algorithm falls back to schoolbook, and the relative cost of additions to see the recursion tree grow as Blender bricks, the counted multiplications and additions, the total work compared with schoolbook, and the crossover length. The product is checked against exact big-integer arithmetic.

⚙ Under the hood

The same recursion tree drawn level by level with brick sprites, two squares whose areas are the schoolbook and Karatsuba work, and the cost-ratio curve with the crossover marked. Same shared counting model and numerical checks as the 3D version.

KaratsubaMultiplication AlgorithmDivide and ConquerRecurrenceTime Complexity

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)