Problem 179. Monte-Carlo integration
Solution Stats
Problem Comments
-
6 Comments
I'm confused by the 3rd test case. Can the integral inside an n-dimensional hypercube really be greater than 1?
In my comment, I mean an n-dimensional UNIT hypercube, which is what you integration limits impose.
Of course. It depends on the integrand. Even in 1d, if the integrand is e.g. 10x, the result will be 5.
I was confused. Thanks for clarifying.
I found it helpful to think about the problem as involving d+1 dimensions: the d dimensions of the input variables, and one more dimension for the (scalar) output variable. —DIV
This problem makes no sense. fun = @(x) x(1)*x(2) needs two inputs. You do not provide enough information for a solution.
Solution Comments
Show commentsProblem Recent Solvers64
Suggested Problems
-
Numbers with prime factors 2, 3 and 5.
426 Solvers
-
1115 Solvers
-
Piecewise linear interpolation
496 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
8757 Solvers
-
Generate a random matrix A of (1,-1)
254 Solvers
More from this Author7
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!