I have generated 1000 random points ranging from 0 to 500. I would like to randomly select one point and then predict the probability of selecting that point. Could someone please help?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I will assume your random points are stored in a vector x:
The probability of selecting any single point in that set of random numbers is exactly 1/1000. So you don’t need to compute that.
To select a random item just use something like this:
where randi just returns a random integer in the [1,1000] interval.