Skip to main content
Post Closed as "Duplicate" by Kuba
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

I'm trying to understand an answer to the question: How to do algebra on summations of variable expressions?How to do algebra on summations of variable expressions? The following input:

reindex = s : sum[_, {i_, __}] :> (s /. i -> Unique[ToString[i]]);
unpower = s_sum^p_Integer :> Times @@ Table[s /. reindex, {p}];
test = (5*sum[x[k], {k, 1, kk}])^2;
test /. unpower

Out[4]= 25 sum[x[k3], {k3, 1, kk}] sum[x[k4], {k4, 1, kk}]

produces result, that differs from result produced by expressions ($25\neq625$):

unpowerstep1 = s_sum^p_Integer :> Table[s /. reindex, {p}];
intermediate = test /. unpowerstep1
Times @@ intermediate

Out[6]= {25 sum[x[k5], {k5, 1, kk}], 25 sum[x[k6], {k6, 1, kk}]}    
Out[7]= 625 sum[x[k5], {k5, 1, kk}] sum[x[k6], {k6, 1, kk}]

Also, I cannot undestand what s_sum mean. Does it mean, that s is any expression with head sum?

I'm trying to understand an answer to the question: How to do algebra on summations of variable expressions? The following input:

reindex = s : sum[_, {i_, __}] :> (s /. i -> Unique[ToString[i]]);
unpower = s_sum^p_Integer :> Times @@ Table[s /. reindex, {p}];
test = (5*sum[x[k], {k, 1, kk}])^2;
test /. unpower

Out[4]= 25 sum[x[k3], {k3, 1, kk}] sum[x[k4], {k4, 1, kk}]

produces result, that differs from result produced by expressions ($25\neq625$):

unpowerstep1 = s_sum^p_Integer :> Table[s /. reindex, {p}];
intermediate = test /. unpowerstep1
Times @@ intermediate

Out[6]= {25 sum[x[k5], {k5, 1, kk}], 25 sum[x[k6], {k6, 1, kk}]}    
Out[7]= 625 sum[x[k5], {k5, 1, kk}] sum[x[k6], {k6, 1, kk}]

Also, I cannot undestand what s_sum mean. Does it mean, that s is any expression with head sum?

I'm trying to understand an answer to the question: How to do algebra on summations of variable expressions? The following input:

reindex = s : sum[_, {i_, __}] :> (s /. i -> Unique[ToString[i]]);
unpower = s_sum^p_Integer :> Times @@ Table[s /. reindex, {p}];
test = (5*sum[x[k], {k, 1, kk}])^2;
test /. unpower

Out[4]= 25 sum[x[k3], {k3, 1, kk}] sum[x[k4], {k4, 1, kk}]

produces result, that differs from result produced by expressions ($25\neq625$):

unpowerstep1 = s_sum^p_Integer :> Table[s /. reindex, {p}];
intermediate = test /. unpowerstep1
Times @@ intermediate

Out[6]= {25 sum[x[k5], {k5, 1, kk}], 25 sum[x[k6], {k6, 1, kk}]}    
Out[7]= 625 sum[x[k5], {k5, 1, kk}] sum[x[k6], {k6, 1, kk}]

Also, I cannot undestand what s_sum mean. Does it mean, that s is any expression with head sum?

added 2 characters in body
Source Link
LCarvalho
  • 9.3k
  • 5
  • 40
  • 97

I'm trying to understand an answer to the question: How to do algebra on summations of variable expressions? The following input:

reindex = s : sum[_, {i_, __}] :> (s /. i -> Unique[ToString[i]]);
unpower = s_sum^p_Integer :> Times @@ Table[s /. reindex, {p}];
test = (5*sum[x[k], {k, 1, kk}])^2;
test /. unpower

Out[4]= 25 sum[x[k3], {k3, 1, kk}] sum[x[k4], {k4, 1, kk}]

produces result, that differs from result produced by expressions ($25\neq625$):

unpowerstep1 = s_sum^p_Integer :> Table[s /. reindex, {p}];
intermediate = test /. unpowerstep1
Times @@ intermediate

Out[6]= {25 sum[x[k5], {k5, 1, kk}], 25 sum[x[k6], {k6, 1, kk}]}    
Out[7]= 625 sum[x[k5], {k5, 1, kk}] sum[x[k6], {k6, 1, kk}]

Also, I cannot undestand what s_sums_sum mean. Does it mean, that s is any expression with head sum?

I'm trying to understand an answer to the question: How to do algebra on summations of variable expressions? The following input:

reindex = s : sum[_, {i_, __}] :> (s /. i -> Unique[ToString[i]]);
unpower = s_sum^p_Integer :> Times @@ Table[s /. reindex, {p}];
test = (5*sum[x[k], {k, 1, kk}])^2;
test /. unpower

Out[4]= 25 sum[x[k3], {k3, 1, kk}] sum[x[k4], {k4, 1, kk}]

produces result, that differs from result produced by expressions ($25\neq625$):

unpowerstep1 = s_sum^p_Integer :> Table[s /. reindex, {p}];
intermediate = test /. unpowerstep1
Times @@ intermediate

Out[6]= {25 sum[x[k5], {k5, 1, kk}], 25 sum[x[k6], {k6, 1, kk}]}    
Out[7]= 625 sum[x[k5], {k5, 1, kk}] sum[x[k6], {k6, 1, kk}]

Also, I cannot undestand what s_sum mean. Does it mean, that s is any expression with head sum?

I'm trying to understand an answer to the question: How to do algebra on summations of variable expressions? The following input:

reindex = s : sum[_, {i_, __}] :> (s /. i -> Unique[ToString[i]]);
unpower = s_sum^p_Integer :> Times @@ Table[s /. reindex, {p}];
test = (5*sum[x[k], {k, 1, kk}])^2;
test /. unpower

Out[4]= 25 sum[x[k3], {k3, 1, kk}] sum[x[k4], {k4, 1, kk}]

produces result, that differs from result produced by expressions ($25\neq625$):

unpowerstep1 = s_sum^p_Integer :> Table[s /. reindex, {p}];
intermediate = test /. unpowerstep1
Times @@ intermediate

Out[6]= {25 sum[x[k5], {k5, 1, kk}], 25 sum[x[k6], {k6, 1, kk}]}    
Out[7]= 625 sum[x[k5], {k5, 1, kk}] sum[x[k6], {k6, 1, kk}]

Also, I cannot undestand what s_sum mean. Does it mean, that s is any expression with head sum?

added outputs to clarify the difference in results
Source Link
Shinrei
  • 177
  • 9

I'm trying to understand an answer to the question: How to do algebra on summations of variable expressions? The following input:

reindex = s : sum[_, {i_, __}] :> (s /. i -> Unique[ToString[i]]);
unpower = s_sum^p_Integer :> Times @@ Table[s /. reindex, {p}];
test = (5*sum[x[k], {k, 1, kk}])^2;
test /. unpower 

Out[4]= 25 sum[x[k3], {k3, 1, kk}] sum[x[k4], {k4, 1, kk}]

produces result, that differs from result produced by expressions ($25\neq625$):

unpowerstep1 = s_sum^p_Integer :> Table[s /. reindex, {p}];
intermediate = test /. unpowerstep1
Times @@ intermediate

Out[6]= {25 sum[x[k5], {k5, 1, kk}], 25 sum[x[k6], {k6, 1, kk}]}    
Out[7]= 625 sum[x[k5], {k5, 1, kk}] sum[x[k6], {k6, 1, kk}]

Also, I cannot undestand what s_sum mean. Does it mean, that s is any expression with head sum?

I'm trying to understand an answer to the question: How to do algebra on summations of variable expressions? The following input:

reindex = s : sum[_, {i_, __}] :> (s /. i -> Unique[ToString[i]]);
unpower = s_sum^p_Integer :> Times @@ Table[s /. reindex, {p}];
test = (5*sum[x[k], {k, 1, kk}])^2;
test /. unpower

produces result, that differs from result produced by expressions:

unpowerstep1 = s_sum^p_Integer :> Table[s /. reindex, {p}];
intermediate = test /. unpowerstep1
Times @@ intermediate

Also, I cannot undestand what s_sum mean. Does it mean, that s is any expression with head sum?

I'm trying to understand an answer to the question: How to do algebra on summations of variable expressions? The following input:

reindex = s : sum[_, {i_, __}] :> (s /. i -> Unique[ToString[i]]);
unpower = s_sum^p_Integer :> Times @@ Table[s /. reindex, {p}];
test = (5*sum[x[k], {k, 1, kk}])^2;
test /. unpower 

Out[4]= 25 sum[x[k3], {k3, 1, kk}] sum[x[k4], {k4, 1, kk}]

produces result, that differs from result produced by expressions ($25\neq625$):

unpowerstep1 = s_sum^p_Integer :> Table[s /. reindex, {p}];
intermediate = test /. unpowerstep1
Times @@ intermediate

Out[6]= {25 sum[x[k5], {k5, 1, kk}], 25 sum[x[k6], {k6, 1, kk}]}    
Out[7]= 625 sum[x[k5], {k5, 1, kk}] sum[x[k6], {k6, 1, kk}]

Also, I cannot undestand what s_sum mean. Does it mean, that s is any expression with head sum?

Source Link
Shinrei
  • 177
  • 9
Loading