-1
$\begingroup$

I have the following data (a shorter sample of the whole data) :

data = {{1, {{0, 1}}}, {3/2, {{0, 1}}}, {2, {{0, 1}}}, {5/2, {{0, 1}}}, {3, {{0, 1}}}, {7/2, {{2, 1}, {1, 0}, {0, 1}}}, {4, {{2, 1}, {1, 0}, {0, 1}}}, {9/2, {{3, 1}, {2, 1}, {1, 0}, {0, 1}}}, {5, {{3, 1}, {2, 1}, {1, 0}, {0, 1}}}}

A generic element in the data is given by, {9/2, {{3, 1}, {2, 1}, {1, 0}, {0, 1}}}.

The 1st entry of it is some x. Given that x, there can be different y values namely there are only one y=3, one y=2, zero y=1 and one y=0.

I want to have a "degeneracy" function f[x,y] which contains all the information from the data and want to study the asymptotics of that function. E.g. For fixed y/x and x -> Infinity what is the behaviour of (f[x,y]-f[x,0])/y?

Edit : The given x and y the function f[x,y] is known. From the above data, f[9/2,2]=1 , f[4,1]=0, f[3/2,0]=1, and so on.

$\endgroup$
  • $\begingroup$ Then what are those 1, 1, 0, 1? $\endgroup$ – Αλέξανδρος Ζεγγ Nov 22 '18 at 2:45
  • 1
    $\begingroup$ Can you give the expected output for the data that you have given? $\endgroup$ – bill s Nov 22 '18 at 6:28
  • $\begingroup$ I know the outputs from data as following. f[9/2,2]=1 , f[4,1]=0, f[3/2,0]=1, and so on. $\endgroup$ – Physics Moron Nov 22 '18 at 9:34
  • $\begingroup$ Maybe transforming the data into a more "regular" form (a List of {x, y, z}s) is constructive: Flatten /@ Catenate[Thread /@ data]. $\endgroup$ – Αλέξανδρος Ζεγγ Nov 22 '18 at 11:17
1
$\begingroup$

Still not quite sure about what you want. But if your data contain the information needed to provide the output for f[x,y] then you may make better use of your data by converting it to an Association:

assoc = AssociationThread[
    data[[All, 1]], 
    data[[All, 2]] // Map@Function[list,
       AssociationThread[
           list[[All, 1]],
           list[[All, 2]]
       ]
    ]
];

Now you can "lookup" the value for f[x,y] in your data simply by assoc[x,y]:

assoc[9/2,2]
(* 1 *)

Making this more comfortable:

f[ x_?NumericQ, y_?NumericQ, data_Association:assoc ] := Module[
    { 
        result 
    },
    result = data[ x, y ];
    If[ MissingQ @ result,
        $Failed,
        result
    ]
]

Testing with your "test cases":

f @@@ { {9/2, 2}, {4, 1}, {3/2, 0} }
(* {1,0,1} *)

Hope this helps for a start.

| improve this answer | |
$\endgroup$
  • $\begingroup$ @Physics Moron Is this helping or do you just put up a question and run? ;-) $\endgroup$ – gwr Nov 28 '18 at 8:09
  • 1
    $\begingroup$ Sorry for the delay! It was useful and I am alive! :-) $\endgroup$ – Physics Moron Dec 6 '18 at 16:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.