Message Boards Message Boards


Select ordered pairs below x^2 and count them?

Posted 5 months ago
2 Replies
2 Total Likes

I have the following code

enter image description here

I want to "Select" those ordered pairs below x^2 and count them.
something like

Count[Select[t,(x=#1, #2<x^2}]]

but that doesn't work, or anything else I have tried.

2 Replies
Posted 5 months ago
In[1]:= t = RandomReal[1, {1000, 2}];

In[2]:= Length@Select[t, #[[2]] < #[[1]]^2 &]
Out[2]= 329
Posted 5 months ago

Beautiful, thank you Hans

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract