Message Boards Message Boards

0
|
1169 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Finding the most-compact form of an expression using Wolfram|Alpha?

Posted 1 year ago

I have many complicated expressions in several English-alphabet variables (15 variables in total, "A" through "O", though not all 15 are in each expression) which I want to simplify, for example:

− A B (C − 2 E) / 2 − A / 2 (G − E) (A − 2 B + G − E) + (I − G) (A (B + C + 2 D − G − I) + (G − F) (I − F)) / 2 − (F − D) (A (A − 2 C − 2 D + I + K) − 2 (G − F) (I − G)) / 2 + (D − B) (A (C + 2 D − F − G) − (A − G + F) (H − F)) + A B C / 2 + B (A (A + B + 2 D − G − H) + (G − F) (H − F))

Which I've so far managed to condense down to:

3 A³ − 1/2 A² (5 K − 7 D − 12 B + 6 A) + A (A (−6 B − 6 D + 3 G + 3 H) + (B + D) (G + H) + 3 F² + F (−3 G − 3 H) + 1/2 (−G² + 4 G H − H²)) + 1/2 (G − F) (H − F) (N − 5 A)

The 15 English-alphabet variables are somewhat linearly dependent, as they arise from different combinations of six Greek-alphabet variables:

  • A := α
  • B := α + β
  • C := 2 α + β
    • = B + A
  • D := 2 α + β + γ
  • E := 3 α + β + γ
    • = D + A
  • F := 3 α + β + γ + δ
  • G := 3 α + β + γ + δ + ε
  • H := 3 α + β + γ + δ + ε + θ
  • I := 3 α + β + γ + δ + 2 ε + θ
    • = H + G − F
  • J := 3 α + β + γ + 2 δ + 2 ε + θ
    • = H + G − D − A
    • = H + G − E
  • K := 4 α + β + γ + 2 δ + 2 ε + θ
    • = H + G − D
  • L := 4 α + β + 2 γ + 2 δ + 2 ε + θ
    • = H + G − B − A
    • = H + G − C
  • M := 5 α + β + 2 γ + 2 δ + 2 ε + θ
    • = H + G − B
  • N := 5 α + 2 β + 2 γ + 2 δ + 2 ε + θ
    • = H + G − A
  • O := 6 α + 2 β + 2 γ + 2 δ + 2 ε + θ
    • = H + G

From these definitions, we can work in reverse to find that

  • α = A = C − B = E − D = K − J = M − L = O − N
  • β = B − A = N − M
  • γ = D − A − B = D − C = L − K
  • δ = F − A − D = F − E = J − I
  • ε = G − F = I − H
  • θ = H − G

This means that there are different but equivalent ways to write complicated expressions, for example, by replacing "12 D − 5 G − 5 H" with "7 D − 5 K" or vice-versa. It is not always obvious to me where such substitutions can be made or where such substitutions will result in a longer or shorter-expression overall.

Is there an efficient way to search for the most compact possible representation of the complicated expressions using the English-alphabet variables? Specifically, I want the fewest possible number of instances of each variable, not necessarily the fewest number of individual variables used, so a form of an expression that only uses the variables "A", and "B" (2 variables) and which uses "A" four times and "B" five times (9 instances) is less optimal than a form of the same expression which uses the variables "A", "B", and "C" (3 variables) and which uses "A" one time, "B" two times, and "C" three times (6 instances).

My current method is to replace all English-alphabet variables in the initial form of an expression with their Greek-alphabet definitions, simplify the resulting much-longer expression as much as possible with Wolfram|Alpha, replace the Greek-alphabet variables with their English-alphabet equivalents, and again simplify that new expression as much as possible with Wolfram|Alpha, looking for possible substitutions at each step and regularly checking that each new form of the expression is equal to the original form to make sure I don't accidentally flip a sign or drop a parenthesis.

This process is somewhat tedious, and I don't have any way to feel confident that I'm finding the shortest-possible representation of each expression. Is there a better way? I have more than 40 expressions to simplify in total, so even a small improvement in the procedure could add up to a large reduction in the overall effort.

POSTED BY: Z L
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract