No problem. Glad to help.

]]>I should have searched before asking!]]>

Try MovingAverage in the help.

]]>Yes!

Is there any command in Mm to get moving averages?

That is close!

]]>I think I got a hang of doing things in J.

Here's a simulation for an approximate answer:

```
sim=: 3 : '0=+/+/(2 4 8 16)=/2+/\(20?20){5#1 2 4 8'
((!20)%(!5)^4)*(+/%#)(sim "0) 1000000#0
```

= 135712661.692608

]]>This came up on another discussion group. Here I will show how easy this is to do with mathematica.

**There are 5 different red balls, 5 different green balls, 5 different blue balls and 5 different black balls. In how many ways can they be arranged so that no two balls of same color are adjacent ?**

The whole problem condenses down to this expression. ( I want to thank Robert Israel for showing me this idea.)

This produces an extremely large polynomial in 4 variables. The coefficient of

is the answer. We get it with the extremely powerful command:

Coefficient[ans, w^5 x^5 y^5 z^5]

the answer is 134631576.

]]>