# How do I fill a table with values from my function?

With the following function,

 PoissonBinomialSuccess[plist_, t_] := Flatten[With[{n = Length@plist, c = Exp[(2 I \[Pi])/(Length@plist + 1)]}, success = Probability[{k >= t}, k \[Distributed] (ProbabilityDistribution[Re[1/(n + 1) Sum[c^(-l k) Product[1 + (c^l - 1) plist[[m]], {m, 1, n}], {l,0, n}]], {k, 0, n, 1} ])]]] /; AllTrue[plist, 0 <= # <= 1 &]


I wish to populate a table with outputs by that function. For example, defining $$plist$$ and $$t$$ as shown below, I would like to create a table. The purpose is to create a 3D plot.

Edit / Clarification: I am only interested in the information that I have indicated by the square (so, the headings are unimportant). Also, the plists are vectors of homogeneous probabilities, that increment by some fixed magnitude. For example {0, 0, 0, 0, 0}, {0.1, 0.1, 0.1, 0.1, 0.1}, {0.2, 0.2, 0.2, 0.2, 0.2}, ... {1, 1, 1, 1, 1}.

For example, using @Bob Hanlon's approach below, the following is what I image. But I am very surprised that it appears problematic to display a 3D plot of the content:

TableForm[ table = Outer[PoissonBinomialSuccess[#1, #2][[1]] &, plist, tlist, 1]]


Look at documentation for Outer

PoissonBinomialSuccess[plist_, t_] :=
Flatten[
With[{
n = Length@plist,
c = Exp[(2 I π)/(Length@plist + 1)]},
success = Probability[{k >= t},
k \[Distributed] (ProbabilityDistribution[Re[1/(n + 1)*
Sum[
c^(-l k)*
Product[
1 + (c^l - 1) plist[[m]],
{m, 1, n}],
{l, 0, n}]],
{k, 0, n, 1}])]]] /;
AllTrue[plist, 0 <= # <= 1 &]


EDIT:

plist = ConstantArray[#, 5] & /@ Range[0, 1, .1];

tlist = Range[5];

TableForm[
table = Outer[
PoissonBinomialSuccess[#1, #2][[1]] &,
plist, tlist, 1],
StringForm["plist=", #] & /@ plist,
StringForm["t=", #] & /@ tlist},
TableAlignments -> {".", Center}]


EDIT 2:

ListPlot3D[Table[
{p, t, PoissonBinomialSuccess[ConstantArray[p, 5], t][[1]]},
{p, 0, 1, .05}, {t, Range[5]}] // Flatten[#, 1] &,
AxesLabel -> (Style[#, 12, Bold] & /@{"p", "t", "Success"})]


• my aim is to create plist as lists of homogeneous probabilities that increments from 0 to 1. It doesn't look as if Tuples can help me do that. Apr 29, 2019 at 21:50
• @user120911 - recommend that you edit your question to clarify how plist is defined. Apr 29, 2019 at 22:22
• I should have been more clear. My apologies. This answer is almost as I imaged. I imagined only the core part (without the headings), but again, I probably was not very clear about thaty either. I will edit my question, as you suggest. Apr 30, 2019 at 0:48
• @user120911 - the "core" part is defined in the code as table. You can display it by table//Grid or table//MatrixForm Apr 30, 2019 at 0:52
• The following is exactly what I imaged. But I am very surprised that it is problematic to display a 3D plot of the content: TableForm[ table = Outer[PoissonBinomialSuccess[#1, #2][[1]] &, plist, tlist, 1]] Apr 30, 2019 at 1:04