Problem 42670. If you prick us, do we not bleed?
While doing some quick sewing to fix up your child's Halloween costume, you accidentally jab your finger with the needle. Reflexively, you drop the needle on the hardwood floor. To take your mind off of the pain, you notice that the needle has a length of L cm, and the boards in your floor are all T cm apart.
Taking a break from your sewing, you decide to write out (you can't type very well just yet, since your finger still hurts!) a MATLAB script that will determine the probability of a dropped needle touches at least one line between two of your floorboards.
The inputs to your script are L (the length of the needle) and T (the thickness of the planks that make up your hardwood floor.) The output should be the probability that needle intersects at least one line between your floorboards.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers22
Suggested Problems
-
101316 Solvers
-
17102 Solvers
-
Project Euler: Problem 3, Largest prime factor
1430 Solvers
-
152 Solvers
-
Generate a string like abbcccddddeeeee
263 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!