Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q 2 . ( 1 5 points ) Consider the following problem: Five points ( A , B , C , D , E )
Q points Consider the following problem:
Five points ABCDE not necessarily different, are selected on a number line so that the distance between any two of these points is at most 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 Nx matrix with the following constraints:
First column is ie A
Fifth column is ie E so the distance between A and E is
Second, third and fourth columns are random real numbers between and
Sixth column is the sum of the distances between points AB distance AC distance AD distance AE distance which is BC distance DE distance
Your output should look like:
Max value is xxxx
The numbers are: xxxxxxxxx
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 numbers which would give your theorized max sum.
The maximum possible value is XXXX
Five numbers that give this are: xxxxxxxxx
IN MATLAB CODE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started