(a) Find the cosine of the angle between the lines L1 and L2 whose vector equations are given below:
L1 : ~r1(t) = [1, 1, 1] + t[1, 2, 3]
L2 : ~r2(t) = [1, 1, 1] + t[−1, 4, 2].
(b) Find the equation of the plane that contains both L1 and L2.
The intersection of two lists L1 and L2, L1 ∩ L2, is defined as
the list containing elements in both L1 and L2 only. Given
two sorted lists L1 and L2, write a function, called intersection,
to compute L1 ∩ L2 using only the basic list operations.
The intersection function is defined as follows template list
intersection( const list & L1, const list & L2);
C++
Given two sorted lists, L1 and L2, write an efficient C++ code
to compute L1 ∩ L2 using only the basic STL list operations. What
is the running time of your algorithm?
1. Write a Racket function (set-equal? L1 L2) that tests whether
L1 and L2 are equal. Two sets are equal if they contain exactly the
same members, ignoring ordering (or in other words, two sets are
equal if they are a subset of each other).
For example (set-equal? '(1 (2 3)) '((3 2) 1)) ---> #t
(set-equal? '(1 2 3) '((3 2)1)) ---> #f
(set-equal? '(1 2 3) '((1 2 3))) ---> #f
2. Two common operations on sets are...
1)Given a list L1, create a list
L2 that contains all but the last element of
L1 (e.g. if L1 is ["a","z",True],
L2 should be equal to ["a","z"]
2)Given a string s, assign a variable
has_z that is True if s contains
the letter "z" anywhere within it.
3)Write Python code that calculates the mean of a given list of
numbers x and saves the result in a variable
m.
4)Given two numeric variables, x and
y, assign the maximum...
Recall that given a line L1 in the plane with slope m, a second
line L2 is perpendicular to L1 if and only if the slope of L2 is −
1 m . Now consider the function h(x) = x^2 + 3/2x + 3. Among all of
the lines tangent to the graph of h(x), there is exactly one which
is perpendicular to the line given by y = −2x + 7. Write the
equation of that line tangent to...