p-norms are mathematical distance functions with interesting properties and applications. The most well-known 3 norms are the 1-norm, 2-norm, and infinity norms, and they are defined, below. The 2-norm is simply the Euclidean distance. It is the shortest distance possible between two points. However, some real life applications makes it impossible to use the 2-norm. For example, a Robot that wants to move in a room that has obsticales (tables, chairs, furniture,.. etc) can not use the 2-norm distance metric. Instead, it will use the 1-norm distance which allows the Robot to go around room objects. The same is true for a human or robot taxi cab that will have to go around the building blocks. This is the reason why the 1-norm distance metric is often called the "Taxi cab distance". The distance is computed using the sum of all distances travelled around the city block, or room objects if used inside a room. The infinity-norm computes the maximum of absolute values, given a number of values. For example, the infinity norm of this set of numbers: (-6, 3, 4) is 6. The infinity-norm for 2 points that have 2 dimensions, x and y, is simply the largest distance in either x or y dimensions, as shown in the equations, below. In other words, for a robot that is travelling around a long building, the infinity-norm tells us which distance is larger, the length (x) or width (y) of the building. Write Python code for the 3 norm distances, for 2 points in the plane, using the equations below. Your input values should be converted to float (no need to validate the float input). Your code should use input validation for the 3 norm names, as shown in the sample runs. Use the sample runs, below to guide your program output.
p-norms are mathematical distance functions with interesting properties and applications. The most well-known 3 norms are the 1-norm, 2-norm, and infinity norms, and they are defined, below. The 2-norm is simply the Euclidean distance. It is the shortest distance possible between two points. However, some real life applications makes it impossible to use the 2-norm. For example, a Robot that wants to move in a room that has obsticales (tables, chairs, furniture,.. etc) can not use the 2-norm distance metric. Instead, it will use the 1-norm distance which allows the Robot to go around room objects. The same is true for a human or robot taxi cab that will have to go around the building blocks. This is the reason why the 1-norm distance metric is often called the "Taxi cab distance". The distance is computed using the sum of all distances travelled around the city block, or room objects if used inside a room. The infinity-norm computes the maximum of absolute values, given a number of values. For example, the infinity norm of this set of numbers: (-6, 3, 4) is 6. The infinity-norm for 2 points that have 2 dimensions, x and y, is simply the largest distance in either x or y dimensions, as shown in the equations, below. In other words, for a robot that is travelling around a long building, the infinity-norm tells us which distance is larger, the length (x) or width (y) of the building. Write Python code for the 3 norm distances, for 2 points in the plane, using the equations below. Your input values should be converted to float (no need to validate the float input). Your code should use input validation for the 3 norm names, as shown in the sample runs. Use the sample runs, below to guide your program output.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Don't use ai to answer I will report your answer
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education