|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Math Quiz 9
Quote:
Last edited by Hitchhiker 42 : 16-07-2016 at 22:01. |
|
#2
|
|||||
|
|||||
|
Re: Math Quiz 9
My simple Python Monte Carlo script gave me an average of 0.521408 (or 0.52141 rounded to 5 digits) in ~5e9 iterations (10 miles of hiking worth).
Code is below: Code:
import numpy as np
iterations = 10000000
avg = 0
for i in range(100000):
for i in range(iterations):
pos = np.random.rand(4)
length = np.sqrt((pos[0]-pos[1])**2+(pos[2]-pos[3])**2)
avg = (avg*i + length)/(i+1)
with open("test.txt", "a") as f:
f.write(str(avg)+'\n')
Code:
import numpy as np
f = np.loadtxt('test.txt')
print(np.average(f))
print(len(f))
Edit: Reps to whoever finds the bug in my code and explains what it does. Last edited by z_beeblebrox : 16-07-2016 at 22:57. Reason: New challenge |
|
#3
|
||||
|
||||
|
Re: Math Quiz 9
That is the correct answer. Reps to you
![]() |
|
#4
|
||||
|
||||
|
Re: Math Quiz 9
Now, how would you get the correct answer accurate to, let's say, 8 decimal places? |
|
#5
|
|||
|
|||
|
Re: Math Quiz 9
Makes no logical sense unless the question is improperly worded or bounded. You can fit an infinite number of lines in the box, and fact is, more lines closer to 0 in length fit in the box than lines averaging 0.52xxxx
|
|
#6
|
|||||
|
|||||
|
Re: Math Quiz 9
I think the problem is more "Choose two random points inside by a 1" square and measure the distance between them. Repeat infinitely. What's the average of those measurements?"
|
|
#7
|
|||
|
|||
|
Re: Math Quiz 9
Quote:
What's the average length of all the line segments which can be drawn inside a 1 inch square? |
|
#8
|
|||||
|
|||||
|
Re: Math Quiz 9
If the problem is interpreted as you describe (What is the average length of all the line segments that could be packed into a 1" square at once without overlapping?), there would be no meaningful answer, since infinite line segments of any length l < sqrt(2)" could be fit within the square, as line segments have no thickness thus can be packed infinitely densely.
Last edited by z_beeblebrox : 16-07-2016 at 22:49. Reason: grammar |
|
#9
|
|||
|
|||
|
Re: Math Quiz 9
Exactly - hence why people struggled to answer I think......
|
|
#10
|
||||
|
||||
|
Re: Math Quiz 9
Quote:
Quote:
Quote:
|
|
#11
|
|||||
|
|||||
|
Re: Math Quiz 9
Quote:
I'm so glad to read that it was #4! |
|
#12
|
|||||
|
|||||
|
Re: Math Quiz 9
I'm not sure why CD wouldn't let me attach a file to a post on this thread, but I've posted my solutions to the cube at this "white paper": https://www.chiefdelphi.com/media/papers/3289.
For any who find this white paper a bit too much, let me simply note here that you don't want to see all of my blind alleys and solutions which worked but were much uglier than what I've shown here. Edit: And OBTW, if anyone feels that my substitutions showed a bit too much prescience, that's ok, because I'm posting this on my birthday, and we should always expect prescience on our birthdays, no? Last edited by GeeTwo : 17-10-2016 at 23:36. |
|
#13
|
||||
|
||||
|
Re: Math Quiz 9
Quote:
It makes no logical sense to say that there are "more" or "less" of one uncountably infinite thing than another uncountably infinite thing. |
|
#14
|
|||
|
|||
|
Re: Math Quiz 9
Quote:
![]() |
|
#15
|
||||
|
||||
|
Re: Math Quiz 9
The question is worded just fine. It asks for an average length of all lines, not the length of the line of most frequent length.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|