Triangles Containing the Origin

You may have found this site by searching for information regarding Project Euler Problem 184. This is not a solution to that problem. In fact, it really bothers me when I find people who post their solutions to these problems online, especially the higher level ones. In this blog post, I talk about a simple problem from probability that was motivated from this Project Euler problem, but the solution to this problem is not likely to help you solve that one.
Pick three points uniformly at random along the circumference of a unit circle centered at the origin. What is the probability that the triangle connecting these three points contains the origin?
Like I said, this problem is not as difficult as the problems that I usually write about, but I decided to write a blog post about it for two main reasons:

I wanted to create the animation/simulation for this problem
I eventually want to extend this problem to explore all convex polygons instead of just triangles (which is a more difficult problem) and I will be able to easily reference this problem if needed
As promised, here is the animation that describes this process. I created this animation with Racket: a functional programming language that makes it extremely easy to work with images. In a future blog post, I will probably talk more about Racket and what I like to use it for, but for now here is the animation.


Popular posts from this blog

Optimal Strategy for Farkle Dice

Markov Chains and Expected Value

Automatically Finding Recurrence Relations from Integer Sequences