Earlier quoted context omitted.
> Why is your construction 'uniform' on the circle? That's a very good question, and the sort of thing that would need to be in a comment somewhere. The answer is that the bi-normal distribution is rotationally symmetrical, a fact that is not immediately obvious. > I'd rather take a random uniform distribution > from 0 to pi and take it as the arc-length. That's a good solution for the simple one-dimensional circle i…
Use a space-filling curve?
My Most Interesting Interview Problem
31–40 of 56 posts
Re: My Most Interesting Interview Problem
#32For the interested, the easieat way of generating random points on a circle is drawing (x,y) component-wise from a normal distribution and then normalizing the vector. (And two independent Gaussian variables can be easily sampled using the Box-Muller transformation.)
I'd rather take a random uniform distribution from 0 to pi and take it as the arc-length. Why is your construction 'uniform' on the circle?
Re: My Most Interesting Interview Problem
#33Earlier quoted context omitted.
I'd rather take a random uniform distribution from 0 to pi and take it as the arc-length. Why is your construction 'uniform' on the circle?
I think you meant 2*pi? Wouldn't that only fill the top half of the circle?
Not that it matters much, being a lecturer in Mathematics...
Re: My Most Interesting Interview Problem
#34What are the practical applications to something like this?
DirectInput joystick data outputs a square range (0,0)->(65535,65535) which is usually uniformly remapped to a circle to be used by the game. Then you have to add in a dead zone to eliminate the noise from the controller around the neutral position.
Re: My Most Interesting Interview Problem
#35Re: My Most Interesting Interview Problem
#36in clear probability related context, the guy uses "uniformly distributed" and "normally distributed" interchangeably. I usually fail interview with such guys. The most recent spectacular failure happened when interviewer asked about sets, i described Java Set interface as an example (they are Java shop so i thought the choice was right), looking dissatisfied he asked to talk about "sets" in general, and got, lets sa…
Re: My Most Interesting Interview Problem
#37in clear probability related context, the guy uses "uniformly distributed" and "normally distributed" interchangeably. I usually fail interview with such guys. The most recent spectacular failure happened when interviewer asked about sets, i described Java Set interface as an example (they are Java shop so i thought the choice was right), looking dissatisfied he asked to talk about "sets" in general, and got, lets sa…
Re: My Most Interesting Interview Problem
#38Doing it about points in a circle made me think of a different problem (which is also interesting)
(Just to clarify, the circumference is the line that contains a circle. I assume that won't be misnamed in a geometry problem of this kind)
Re: My Most Interesting Interview Problem
#39Earlier quoted context omitted.
I have to disagree with this. It would easier conceptually and faster computationally to use rejection sampling: do { x = uniform() y = uniform() r = x*x + y*y } while (r > 1) x = x/sqrt(r) y = y/sqrt(r) This does generalize to higher dimensions d, although as d gets large, you waste more samples. For spheres embedded in a handful of dimensions, it would still be fine, and it avoids all the transcendental functions a…
It's simple, clean, clear, and works well in low dimensions. I regularly work in a few thousand dimensions, and it doesn't work at all because the volume of the sphere is too small. These are great discussions to have with a candidate. If they already know these things then you can see if they understand why, and if they don't already know these things, you can see how they react to learning new and rather esoteric s…
Re: My Most Interesting Interview Problem
#40For a general-purpose developer interview question, I think this relies a little too heavily on domain-specific knowledge to be generally useful. Personally, while I was quite decent at algebra and geometry in university, my skills have atrophied significantly, to the extent that I really didn't know where to start with this problem. I don't think it represents what most programmers do on a day-to-day basis, and some…
Interviews are tricky to get right. It's my opinion that interviews should aim to prove that the candidate knows enough to do the day-to-day work, plus test for good personality fit etc. After that, there should be a short probation period to learn more about each other.
Honestly, my perfect interview (as a candidate) would be a quick chat about my previous work experience, some one-on-one work with another developer to solve a common problem the company faces and then a few drinks with the team to get to know everyone.