# Solving equations using reinforcement learning

I was lately curious about a reinforcement learning approach that would solve maths equations.

For example, if I have the following equation:

$$f(g(h(w))) = 0 , with \ w = \begin{matrix} a_{11} & 0 & \ldots & a_{1n}\\ 0 & a_{22} & \ldots & a_{2n}\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 &\ldots & a_{nn} \end{matrix}$$

Along additional constraints on the 3 functions like $$f < g$$; $$h > 2 * g$$; and $$f, g,h$$ not constant

The goal is to find the 3 functions expressions given a specific matrix $$w$$ and the constraints.

Can I use reinforcement learning to find a solution or solutions to this problem ?

Thank you

• The equation and its constraints seem odd. Since $f(x)=0$ is a valid function given your constraints, it looks like you have an infinite number of trivial answers. Are you sure that is the form of the equation that you want to solve? You may also wish to specify the input and output domains of each function. Nov 5 '18 at 8:12
• My goal is to do some statistical analysis on the solutions. If there are infinite solutions, I would then just pick a subset. But that's not the question. I am looking for an efficient method to get let's say 10 possible solutions to the equation. for simplicity's sake, We could start with functions defined in the integer space for instance. Nov 5 '18 at 23:50
• Something is still wrong. I'm not sure why you cannot see it. For instance I can generate 10 solutions to your equation as written trivially. E.g. 1: $f(x)=0, g(x) = 1, h(w)=3$ 2: $f(x)=0, g(x) = 2, h(w)=5$ , 3: $f(x)=0, g(x) = 3, h(w)=7$ . . . etc. Something must be missing from your description, otherwise the original matrix and function composition are completely meaningless. There is no statistical analysis to be had here. Nov 6 '18 at 7:28
• Sorry, I've just updated the post: The matrix $w$ is given and fixed, so are the constraints. The goal is to find the functions expressions ex: $f(x) = 1 / x , g(x) = exp(x), h(x) = sin(x)$. Thank you. Nov 6 '18 at 21:57
• Thanks for the edit. Sorry I still cannot see a way to answer this. Maybe I am missing something though and someone else can answer. My gut feeling is that RL is not going to help you. RL is a very generic learning process so it is possible to frame a wide range of problems using it, but this is not generally advisable as the performance could be very poor compared to a more direct solution. Nov 7 '18 at 10:50