![]() |
Re: Math Quiz 9
Quote:
If you can answer my first question (with calculus if you know any), try this one (again with calculus if you know any): What is the average x coordinate of all ordered pairs (x,y) within the range 0<x<1 and 0<y<1? In this scenario, multiple (in fact, uncountably infinite) ordered pairs can contain the same x coordinate, but the statement of the problem is sound. |
Re: Math Quiz 9
Quote:
|
Re: Math Quiz 9
1 Attachment(s)
FWIW |
Re: Math Quiz 9
Quote:
Quote:
Consider the following question: What is the average number of autonomous boulders scored per match by robots in Michigan? To solve this problem, you would first identify all of the robots in Michigan, then determine their autonomous boulders scored per match, then sum each of those scores together, then divide by the number of robots in Michigan. What you cannot do though, is double count 33, quadruple count 67, and triple count 469, while counting all of the other teams once. If you do this, you are not determining a quantity which can be accurately described as "the average number of autonomous boulders scored per match by robots in Michigan." Also, just because two teams score the same number of autonomous boulders does not necessarily make the two teams identical. Likewise, two line segments which have the same length are not necessarily identical. For the OP's question, we could theoretically follow the same procedure: Identify all of the line segments in the set Determine their lengths Sum the lengths together Divide by the number of segments The processes are identical because the definition of average does not change when dealing with infinite sets. The tools of calculus can then be used to arrive at an answer that would otherwise take an infinite amount of time to solve if you were to try to enumerate every line segment. It is a bit unfortunate that our fancy math notation hides the fact that we essentially do the above to arrive at our answer, but that is a small price to pay to be able to determine properties (like average) of infinite sets. I hope that makes things a little clearer. Essentially, it makes no more sense to double count line segments than it does to double count 33's auto boulder scoring ability. The fact that we are dealing with an infinite set does not change anything in that regard. |
Re: Math Quiz 9
Quote:
Quote:
Quote:
|
Re: Math Quiz 9
Quote:
Count the matches played in MI, count the auto boulders scored in those matches, note that humans can't score boulders, and divide the auto boulders scored by the number of matches. Unless you really mean the median or the mode. |
Re: Math Quiz 9
Quote:
|
Re: Math Quiz 9
Quote:
|
Re: Math Quiz 9
Descriptive statistics for 10 million random samples: Code:
|
Re: Math Quiz 9
Quote:
So thanks for the sanity check! Other stats so far:
Definitely an easier way to go unless that last one proves nastier than it looks. Also, doing the integral this way explains the sudden change in behavior of the histogram at length=1. |
Re: Math Quiz 9
Here is a generalized Monte Carlo simulation in python for the average line segment length in any regular polygon with one square unit of area:
Code:
%matplotlib inlineTriangle: 0.554367342879 Square: 0.521395852676 Pentagon: 0.514797872593 Hexagon: 0.512588030594 Heptagon: 0.51176618103 Octagon: 0.511213933924 Nonagon: 0.511120940654 Decagon: 0.511039068646 25-gon: 0.510860752385 100-gon: 0.510794294963 1000-gon: 0.510750983962 1000000-gon: 0.510902061585 Can anyone think of another general way of generating a random point in an n-gon that is more efficient than mine for small values of n (without sacrificing significantly for larger values of n, of course)? When n=3, my program is discarding almost 60% of the points it generates. |
Re: Math Quiz 9
Quote:
2. If xrand+yrand is greater than 1, use the point (1-xrand, 1-yrand) instead. You will now have a point within a right triangle of unit width and height that I will call (x, y). 3. Determine the apothem a and the perimeter p of your regular n-gon. 4. Regular n-gons are made up of n isosceles triangles which have a base width of p/n and a height of a. Each of these isosceles triangles is made up of 2 right triangles of width p/(2n) and height a. Take your point (x, y) and scale it accordingly to a right triangle described above, to get a point (x*p/(2n),y*a). 5. Randomly decide if this point will be on the left or the right half of an isosceles triangle (you could even use the leftover data from part 2 if you don't want to generate another random number). 6. Randomly decide in which of the n isosceles triangles your point should go. 100% of these points will be within your regular n-gon, and the distribution will be uniform. Given, you do need to generate at least 3 random numbers for this process, so if generating random numbers is resource intensive you may want to look for other methods. |
Re: Math Quiz 9
Quote:
Procedurally, calculate W = floor(r1/N); this tells you which wedge you are in (0 to N-1), then use r1 - W/N and r2 to determine where in that wedge as suggested above. To do this (or Caleb's original suggestion) efficiently, you may want to pre-calculate a trig table of appropriate size. Edit - and thanks, Caleb! I was thinking about attacking the same problem with the unit circle next, and I just realized I can adapt this technique to randomly pick r and theta with a uniform spatial distribution. |
Re: Math Quiz 9
Quote:
|
Re: Math Quiz 9
Quote:
What would the distribution look like if the line segments were contained in a cube (3D) boundary? That one may be easier to visualize using a Monte Carlo simulation. |
| All times are GMT -5. The time now is 01:03. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi