I solved it suggesting that the point D could also be a tagent point to the hypotenuse of the triangle with two perpendicular distances. That way if the D point is placed right in the middle of the hypotenuse (segment BC) then it should intersect in the middle the other two segments. See my attached drawing so to understand my thinking.
I think 47 is right, this is how I proved it.
The lengths are 45, 60 and 75.
For clarity sake lets take
3,4 and 5 and then we will scale our answer by 15.
Let the coordinate of the triangle be
(0,0) (3,0) and (0,4)
Equation of Hypotenuses becomes (x/3 + y/4 -1 = 0)
Now any point (x,y) in the triangle would have perpendicular distance from side as
x + y + (12/5 - 0.8x - 0.6x) = 2.4 + 0.2x + 0.4y
distance from x axis + distance from y axis + distance from Hypotenuses
The answer would be expected value of above
2.4 + 0.2[x] + 0.4[y]
[x] in triangle = x co ordinate of centroid = 1
[y] = y co ordinate of centroid = 4/3
substituting the values ans scaling to 15
(2.4 + 0.2 + 1.6/3)15
= 39 + 8
=47
i don't think so,because D(x,y) randomly and uniformly inside the triangle,x and y has relationship as x/3+y/4<1,
Can you explain why [x]=1 [y]=4/3?
Thank you very much
either I am really bad with geometry, either you brought it to a new level smart.
I made a video on this problem a while ago .
Hope you'll find it useful, as there are quite a few different answers in this thread!
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
np.random.seed(42)
x_length = 60
y_length = 45
N = int(1e6)
def get_estimate(N, x_length, y_length):
x_values = np.random.rand(N)*x_length
y_values = np.random.rand(N)*y_length
colors = ["RED" if y_values[n]<= -y_length/x_length*x_values[n] + y_length \
else "BLUE" for n in range(len(x_values))]
figure(figsize=(16, 12), dpi=200)
plt.scatter(x_values, y_values, c=colors, s=1e4/N)
plt.title(f"N={N}")
plt.show()
dists=[]
for n in range(N):
if y_values[n]<= -y_length/x_length*x_values[n] + y_length:
dists.append(36+2/5*x_values[n] + 1/5*y_values[n])
print(f"Simulated sum of distances: {np.mean(dists)}")
I just think about it again. You are right. My method made a mistake where I see X as uniform but it's not.Let's start from the beginning. Here is a simple code that does the computes the same estimate as you do:
Python:import numpy as np import matplotlib.pyplot as plt from matplotlib.pyplot import figure np.random.seed(42) x_length = 60 y_length = 45 N = int(1e6) def get_estimate(N, x_length, y_length): x_values = np.random.rand(N)*x_length y_values = np.random.rand(N)*y_length colors = ["RED" if y_values[n]<= -y_length/x_length*x_values[n] + y_length \ else "BLUE" for n in range(len(x_values))] figure(figsize=(16, 12), dpi=200) plt.scatter(x_values, y_values, c=colors, s=1e4/N) plt.title(f"N={N}") plt.show() dists=[] for n in range(N): if y_values[n]<= -y_length/x_length*x_values[n] + y_length: dists.append(36+2/5*x_values[n] + 1/5*y_values[n]) print(f"Simulated sum of distances: {np.mean(dists)}")
First round, with 10000 simulations(RED points inside the triangle, for which we compute the sum of distances; BLUE points outside the triangle, for which we do nothing)
View attachment 40478
Simulated sum of distances: 46.99828952360751
Second round, with 100000 simulations:
View attachment 40479
Simulated sum of distances: 47.01289711967379
Third round, with 1000000 simulations:
Simulated sum of distances: 46.99724786291175
You can also use a very similar code to check that the expected value of X is indeed 20, not 30.
Even if we were to consider that X~U(0,60), do you also imply that Y~U(0,45)? In this case, and following your logic, E[2X+Y] = 82.5, which gives an expected sum of distances of 52.5;