I'm trying to create a piecewise function with y values {.1, .2, .342, .353,...,.9} and x-values {1, 2, 3, 4,...,n}. My end goal is to do this: Define a simple discrete probability distribution and then calculate x-values given y-values. For example, given 0.11, I should get back 2. Given 0.05, I should get back 1. Etc.
So far, I've tried
Piecewise[{distrib[[x]], 0 < x < Length[distrib]}]
This didn't work (I don't know why)
and
Distrib = ProbabilityDistribution[distrib[[x]], {x, 1, Length[distrib]}]
This wouldn't let me create an InverseCDF.
Any suggestions?