Problem 7

Please have the user enter the numbers in the list. Write a function to check that the two vectors (lists) are the same size as well as doing what the problem says.

Additional Problem

Write a program that displays the first and last words of a sentence input by the user. Assume that the only punctuations is a period at the end of the sentences.

Chapter 9 Problem 2

Is a pair a generalization of a tuple, or is a tuple a generalization of a pair?

Chapter 9 Problem 3

Is a pair a kind of tuple, or is a tuple a kind of pair?

Chapter 11 Problem 6

Write a function scalar_mult(s, v) that takes a number, s, and a list, v and returns the scalar multiple of v by s. :

test(scalar_mult(5, [1, 2]), [5, 10])
test(scalar_mult(3, [1, 0, -1]), [3, 0, -3])
test(scalar_mult(7, [3, 0, 5, 11, 2]), [21, 0, 35, 77, 14])

Chapter 11 Problem 7

Write a function dot_product(u, v) that takes two lists of numbers of the same length, and returns the sum of the products of the corresponding elements of each (the dot_product).

test(dot_product([1, 1], [1, 1]), 2)
test(dot_product([1, 2], [1, 4]), 9)
test(dot_product([1, 2, 1], [1, 4, 3]), 12)
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.