Question: Q 2 . ( 1 5 points ) Consider the following problem: Five points ( A , B , C , D , E )

Q2.(15 points) Consider the following problem:
Five points (A,B,C,D,E), not necessarily different, are selected on a number line so that the distance between any two of these points is at most 1. After calculating the distance between each pair of points, I add all ten distances. What is the greatest possible value of this sum?
Your task is not to solve this problem algebraically (which is tough!). Instead, write a code that takes advantage of the speed of modern computers by checking many possible solutions. For example, you might make a script to build an Nx6 matrix with the following constraints:
First column is 0(i.e. A =0)
Fifth column is 1(i.e. E =1, so the distance between A and E is 1)
Second, third and fourth columns are random real numbers between 0 and 1
Sixth column is the sum of the 10 distances between points (AB distance + AC distance + AD distance + AE distance {which is 1}+ BC distance +...+ DE distance)
Your output should look like:
Max value is x.xxx .
The 5 numbers are: 0,0.xxx,0.xxx,0.xxx,1
Initially you may want N to be a reasonably small integer so you can look at the data and debug. Once your code is working properly, run your code several times while increasing N as you go look for a pattern. Finally, report the specific output of your code when N is sufficiently large to be sure of your answer.
From the data you generated, replace the Xs in the sentence below by theorizing a general solution to the original question, and specify 5 numbers which would give your theorized max sum.
The maximum possible value is X.XXX .
Five numbers that give this are: 0,0.xxx,0.xxx,0.xxx,1.
IN MATLAB CODE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!