USE R:

Here we will be interested in *permutations*, which are like combinations but with all possible orderings. For instance, suppose we are looking at subsets of 1,2,...,8, taken two at a time. Corresponding to the combination (2,7), the permutations are (2,7) and (7,2). For the combination (1,2,7), the permutations are (1,2,7), (2,1,7), (1,7,2), (7,2,1), (7,1,2) and (2,7,1).

- please help me to find a functions with call form

permn(x,m,FUN)

- analogous to
**combn()**but for permutations.**FUN**(which has no default, i.e. cannot be NULL) is applied to each permutation, so that**permn()**returns a vector consisting of the values of**FUN**at the various permutations of**x**taken**r**at a time. - You will NOT be required to save memory, i.e. if you wish, you can have your
**permn()**first generate all permutations, then call**FUN()**on each one. However,**FUN**must be an argument of**permn()**, as above. - There are permutation generators in the
**partitions**and**gtools**packages, available on CRAN. - Example:

```
first <- function(z) z[1]
permn(7:10,2,first)
[1] 7 8 7 9 7 10 8 9 8 10 9 10
b) Apply your permn() to solve the following problem. We choose 8 numbers, X1,...,X8 from 1,2,...,12. We are interested in the quantity W = Σi=17|Xi+1 - Xi|. Find EW. (Note: This is an exact value, but it is recommended that you check via simulation.)
```

### Recently Asked Questions

- 1.Find the volume of the prism ( cubic inches.) 2. Find the volume of the prism.Round to 1 decimal place. 3.Find the volume of the cylinder.Use 3.14for. 4.

- Hi I am having trouble with this Assessment. The aim of this assessment is to analyse an article taken from the Financial Times (or another relevant economic

- Match each function with the given graph. Explain your reasoning. y=-4\left(\frac{1}{4}\right)^x Function:____________________________ Reason: