I want to produce a 10x10 matrix, where each element within the matrix is evaluated by the above function. where x and y=1,2,..,10, and p=0.3 for example.

So the matrix at (1,1) would be (0.3^1 / (1-0.3)^1)=0.4285714

at (1,2) would be (0.3^1 / (1-0.3)^2)=0.6122449

and so on.

Code:

```
x=c(1,2,3,4,5,6,7,8,9,10)
y=c(1,2,3,4,5,6,7,8,9,10)
func<-function(p,x,y){p^x / (1-p)^y}
matrix(data=func(0.3,x,y),ncol=10,nrow=10)
```

Code:

```
[,1] [,2]
[1,] 0.4285714286 0.4285714286
[2,] 0.1836734694 0.1836734694
[3,] 0.0787172012 0.0787172012
[4,] 0.0337359434 0.0337359434
[5,] 0.0144582614 0.0144582614
```

i tried to use the function outer, but got an error.

Code:

```
> outer(x,y,FUN='func(0.3,x,y)')
Error in get(as.character(FUN), mode = "function", envir = envir) :
object 'func(0.3,x,y)' of mode 'function' was not found
```

thanks