Talk:Constrained random points on a circle: Difference between revisions

Task description thought
(→‎Disappearing code?: it's still good to let us know)
(Task description thought)
Line 1:
==Task Description==
I know this is going to seem knit-picky but I think this would be a clearer description of the task:
 
'Generate 100 <x,y> coordinate pairs such that x and y are integers sampled from the uniform distribution with the condition that <math>10 \leq \sqrt{ x^2 + y^2 } \leq 15 </math>. Then display/plot them. The outcome should be a "fuzzy" circle. The actual number of points plotted may be less than 100, given that some pairs may be generated more than once.
 
There are several possible approaches to accomplish this. Here are two possible algorithms.
 
1) Generate random pairs of integers and filter out those that don't satisfy this condition:
 
10 \leq \sqrt{ x^2 + y^2 } \leq 15.
 
2) Precalculate the set of all possible points (there are 404 of them) and select randomly from this set.'
 
Does anyone agree? Disagree? [[User:Cferri|Chris Ferri]] 23:13, 8 September 2010 (UTC)
 
== Not 100 points ==
There are only 89 points in the circle shown in the verilog example output. This is no surprise, because AFAICS the algorithm doesn't make sure that the same point isn't chosen twice. Now given that it's the first example, I guess it's what was meant by the task description, but then the task description probably should be changed to reflect the fact that less points are OK. --[[User:Ce|Ce]] 10:55, 3 September 2010 (UTC)
Anonymous user