OFFSET
1,94
LINKS
Cristian Mesiano, Table of n, a(n) for n = 1..3239
Cristian Mesiano, Coefficients of Waiting Time Polynomials: a nice representation
FORMULA
a(n) = {i, j, k} : i + j + k = Z;
b(j) = P(A(j));
b(j, k,V) = i;
b(j, k,X) = j;
b(j, k,Y) = k;
for each b(j):
Sum[p_1^i*p_2^j*p_3^k[
Sum[q_V^(d - i)*q_X^(e - j)*q_Y^(g - k)*
Sum[((d - 1)!*Abs[e - d - 1]!)/((i - 1)!* f!*(d - i - f)!*(j - f - 1)!*(e - d - j + f)!), {f, j - Min[j, e - d], 1}],
{d, i, i + j + k - 2}, {e,Max[i + j, d], i + j + k - 1}, {g, i + j + k, i + j + k}]],
{i, 1, Z}, {j, 1, Z - i}, {k, 1, -i - j + Z}]
The series is obtained by taking the coefficients of the polynomials, sorted in lexicographic order, on the exponents of p_1, p_2, p_3.
EXAMPLE:
Z = 10;
a(1)= {1, 1, 8}; a(2) = {1, 2, 7}; a(3)= {1, 3, 6};
b(2)= P(a(2)) = {{1, 2, 7}, {1, 7, 2}, {2, 1, 7}, {2, 7, 1}, {7, 1, 2}, {7, 2, 1}};
i = 1; j = 7; k = 2;
b(2,3)= {2, 1, 7};
b(2,3,V) = 1 -> V = 2;
b(2, 3,X) = 7 -> X = 3;
b(2, 3,Y) = 2 -> Y = 1;
EXAMPLE
Example:
alphabet = {a,b,c};
w(a)=7;
w(b)=5;
w(c)=5;
The number of vectors for which {w(a)=7,w(b)=5,w(c)=5}= 210.
MATHEMATICA
getW[data_, p_] := Block[{p1, p1f, resq},
p1 = Position[data, p];
If[p1 == {}, Return[{{p, 0}, {p, 0}}]];
p1f = Flatten[p1];
resq = {#[[2]] - #[[1]] - 1} & /@ Partition[PrependTo[p1f, 1], 2, 1];
resq[[1]] += 1;
Return[{Select[Tally[data], #[[1]] == p &][[1]], {p,
Plus @@ Flatten[resq]}}]
];
getMonomials[listOfVars_, dL_] := Block[{data, vars, coeff, res},
data = Tuples[listOfVars, dL];
vars =
Thread[{Table[Subscript[p, i], {i, 1, Length[listOfVars]}],
Table[Subscript[q, i], {i, 1, Length[listOfVars]}]}];
coeff =
Table[Thread[getW[data[[i]], #] & /@ listOfVars], {i, 1, Length[data]}];
coeff = #[[All, 2]] & /@ Thread[#] & /@ coeff;
res = Times @@ MapThread[Times, MapThread[Power, {vars, #}]] & /@ coeff;
Return[res];
];
(*select monomials for which all the variables occur at least one time *)
SIZE = 10;
results =
Select[getMonomials[{v1, v2, v3},
SIZE], (Exponent[#, Subscript[p, 1]] >
0) && (Exponent[#, Subscript[p, 2]] > 0) &&
Exponent[#, Subscript[p, 3]] > 0 &];
(*group monomials by same # events realization*)
results =
Gather[results, (Exponent[#1, Subscript[p, 1]] ==
Exponent[#2, Subscript[p, 1]]) && (Exponent[#1, Subscript[p, 2]] ==
Exponent[#2, Subscript[p, 2]]) && (Exponent[#1, Subscript[p, 3]] ==
Exponent[#2, Subscript[p, 3]]) &];
(*sort monomials by lexicographic order on event v1 and v2*)
results = {#[[1, 1 ;; 3]], #[[All, 4 ;; -1]]} & /@ results;
results = Reverse[Sort[results]];
(*polynomial*)
qVals = Plus @@ #[[2]] & /@ results;
(*get coefficients*)
coeff = Table[
If[IntegerQ[qVals[[i]][[j, 1]]] == True, qVals[[i]][[j, 1]], 1], {i, 1,
Length[qVals]}, {j, 1, Length[qVals[[i]]]}];
CROSSREFS
KEYWORD
nonn
AUTHOR
Cristian Mesiano, Mar 24 2014
STATUS
approved