What are the odds? - MATLAB Cody - MATLAB Central

Problem 226. What are the odds?

Two numbers, A and B are drawn randomly and uniformly on [-R,R]. What is the probability that A*B < A+B. Your function should take one variable, R, and return the probability to within 100*eps. For example, if R = 1/2, then the probability should be:

0.560930216216329

Solution Stats

30.1% Correct | 69.9% Incorrect
Last Solution submitted on Dec 12, 2024

Problem Comments

Solution Comments

Show comments
R2025a Pre-release highlights
This topic is for discussing highlights to the current R2025a Pre-release.
13
5

Problem Recent Solvers26

Suggested Problems

More from this Author6

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page