You are currently browsing the tag archive for the ‘mathematica’ tag.

Looks like Mathematica 9 is released. I haven’t yet had a chance to take a look. Glancing through their release notes, a few interesting things I hope to try at some point are

– Signal Processing, which for some reason was fairly week on Mathematics till date, compared to Matlab for instance.

-The (random and social) network analysis tool is something I hope they made powerful.

-Integration with R.

-Time series, random process analysis new features and may be more.

I am caught with a little trouble to figure out an easier way to set up and solve a summation of a function of several variables. I just realized that Mathematica doesnt allow me to add a constraint in the summation operation. My problem is that, the summation should be performed over the ordered partition set of a number.

An example, will illustrate the problem definition a lot better. Suppose I want to compute the sum of a function of variables over all variables such that, the sum of the index variables always equal to a constant .

Clearly, the indices here runs over all the ordered partitions of the number . Since is not that big a number, we can simply write these partitions by hand and somehow get the job done. Let us say denote the ordered partitions and unordered partitions of the number by and respectively.

. The ordered partition will have the permutations of each of these on the three positions! So and are different sets of whereas, they are considered as one in . The summation needs to be carried over the ordered partition list . Since both and grow pretty big with even modest , the job of manual summation is not that appealing. I really hoped mathematica to aid me here. Unfortunately, I don’t see a way out here, other than the painful individual partition sum. Anyway, for the curious reader, the sum I attempt are of the following types:

typical values for is and is around . If any enthused reader finds a way/trick, I will be happy to sponsor a coffee 🙂 (Sorry at this recession time, nothing more 😦 sadly…).

In fact, the first one is easy (Interestingly, I just found a way, while typesetting the blog). I can do a differential with respect to and then scale it to get the requisite sum. It can be written as follows:

Second one is the trouble maker 😦

Oh man! power of a coffee. As I am typing this on a moody Lausanne swiss weather, here comes the trick. I just made a coffee and that seemed to have worked. I guess I can apply a similar trick to the second one too. Basically, we can split them into two expressions and then write each as differential versions of a multinomial sum. Here it is:

Amazingly, we can simplify both to get a simple looking expression. I am glad! Here is what I finally got:

## Recent Comments