Search code examples
machine-learningneural-networkartificial-intelligence

Which neural net architecture could solve the addition of all digits in a number to a single digit?


This is a hypothetical problem that I would like to explore from the perspective of ML.

I have a number like 45624. If I add up all the digits until I have only one left, I'd do the following:

4 + 5 + 6 + 2 + 4 = 21

2 + 1 = 3

How could I use a neural net or any other technique to model that problem?

IMPORTANT:

  1. I know I don't need a neural network or ML for this
  2. I know multiple ways to solve this
  3. This is not a real problem, just a hypothetical one which I want to explore from an ML perspective.

Solution

  • The sum of the digits is a modulo 9 operation. So your problem is equivalent toto teach your network to perform a modulo.

    Here are some interesting elements of answers.