afeddersen

444 Reputation

7 Badges

11 years, 97 days
I study psychology and economics with a very quantitative approach to each. I specialised on statistical methods, quantitative diagnostics, portfoio analysis and econometrics. Furthermore I am interested (and above that theoretically and empirlcally involved) in poker, chess and performing arts.

MaplePrimes Activity


These are questions asked by afeddersen

I started with the following expression:

k := n*(phi+ln(-1/(-exp(phi)+exp(phi)*p-p)))/phi;

 

and two equations:

{p=mu/n};

{n=-((sigma)^(2))/(p*(p-1))};

 

Afterwards I carried out two substitution steps:

1. Substitute mu/n for p in k and store the return as j.

j:=subs({p=mu/n},k);
 

2. Substitute -((sigma)^(2))/(p*(p-1)) for n in j.

I try to find out, whether two expressions are equvalent or identical, respectively.
E.g. I have the following expressions:

m1 := -sigma^2*n*(phi+ln(-1/(-exp(phi)+exp(phi)*mu/n-mu/n)))/(mu*(-1+mu/n)*phi);
m2 := 2*mu*n*(phi+ln(-1/(-exp(phi)+(1/2)*exp(phi)*(n+sqrt(n^2-4*n*sigma^2))/n-(1/2)*(n+sqrt(n^2-4*n*sigma^2))/n)))/((n+sqrt(n^2-4*n*sigma^2))*phi);

 

and I tried to just subtract one from the other and afterwards simplify:

m1-m2;
simplify(%);

I tried to define the following procedure, to shuffle, or randomize a stack 'S':

Mix:=proc(S)
SList:=convert(S,`list`):
subsop(1=NULL,SList):
SSList:=Shuffle(SList):
S:=convert(SSList,`table`):
end proc:

Unfortunately this procedure does not return a stack type, i.e. it transforms S to something different.
Anyway, I need a procedure (or maybe something more efficient), which randomizes a stack and replaces the old stack for the new
randomized one (i.e. S is randomized afterwards and still of type 'stack').

Hi, I am going to do a couple, not to say a lot of, Monte-Carlo-Simulations.

Therefore I need to define a procedure "Shuffle", which shuffles the n elements of a list k times.

e.g.

L := [1,2,3,4,5,6,7,8,9,0];
Shuffle := proc(L,n,??)
"Mixes the ten elements of the list L randomly and most efficient"
end proc;

Does anyone of you know an efficient way to realize that?

Thanks.

I tried the following:

 

First 7 8 9 10 11 12 Page 9 of 12