1
votes

For some list of 2-d points, e.g. data = {{1, 2}, {3,4}, {3, 6}},

and some analytic function, e.g. f[x] = x^2,

I want to select out only those points that lie beneath the curve, i.e., test for each point whether f[x] > y, and eliminate those points for which this is false.

I've tried to do this using Select. Something like: Select[data, #list1 > # [[2]] &][[All, 1]]

where list1 is a list of f[x] values generated by a list of random x values over some domain,

e.g. list1 = {3.285, 2.245, 7.413}

but to no avail. I suppose I am essentially trying to compare two lists (the second elements of data and list1), test which is bigger, and eliminate those points that fail the test. Any tips?

1

1 Answers

2
votes
data = RandomReal[{0, 1}, {100, 2}];
f[x_] := x^2
data1 = Select[data, #[[2]] < f[#[[1]]] &];
Show[Plot[f[x], {x, 0, 1}], ListPlot@data1]

Mathematica graphics