Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • $\begingroup$ Seems to be generating slightly different result than expected - am I using it incorrectly? $\endgroup$ Commented Jan 8, 2014 at 12:12
  • 1
    $\begingroup$ @martin ah I see I copied your brackets around (1-p), those are not supposed to be there $\endgroup$ Commented Jan 8, 2014 at 12:29
  • $\begingroup$ @Jacob Akkerboom Thank you for the detailed explanation. As much as I got you now, the only difference is in timing. No other problem arises, and on the scale of n=2^5 and below the timing makes no real difference. The difference only manifests itself during really long computation. Am I right? I would like to make it sure, since from your comment I had an impression, that there is something else (like some trap when using Append). $\endgroup$ Commented Jan 10, 2014 at 8:30
  • $\begingroup$ @AlexeiBoulbitch you are mostly correct. Do note though that it also uses twice as much memory, as in the end the entire result minus one element has to be copied. But yeah for small manipulations like vars = Hold[a, b]; AppendTo[vars, Unevaluated@c] it is pretty harmless. Just a heads up :). $\endgroup$ Commented Jan 10, 2014 at 11:13