# Where do the radicals end?

In an early iteration of this question on the Mathematics SE, the radicals weren't properly formatted, so they only had the √ symbol with no indication of which terms were supposed to be included under the radical sign. Then the question was, given the expression:

6fg √2g - 5f √18g^3 + 6fg √6g

which of the following is equivalent to it:

1. 6fg√6g -­ 9fg√2g
2. 7fg√2g
3. 6fg√6g -­ 9fg
4. -­3fg√6g

This reminds me of those puzzles where some of the digits in an arithmetic puzzle are missing, and you have to figure them out. So how would you solve this automatically with Mathematica? A neat bonus would be to parse the expressions automatically as well.

• Look at the FullForm – bill s Nov 12 '15 at 17:15
• I hate it when people can't be arsed to parenthesize. :) Still, an interesting puzzle! – J. M. is away Nov 12 '15 at 17:20
• I can think of three "sensible" conventions, radical applies to one symbol, applies to remainder of term, or applies to everything to the right. Probably just as easy to check by hand as to write code to test those.. On the other hand to check every permutation of where you might stick parentheses ( Sqrt[ 2 g - 5 f] ? ) thats a real challenge (note the same ambiguity exists in the multiple choice answers ) – george2079 Nov 12 '15 at 17:33
• @J.M. I wonder if your emoticon should instead be )) [I'd add a colon or period but don't want to go out of bounds with this..] – Daniel Lichtblau Nov 12 '15 at 20:43