Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
1. Write a function vecmul that will take as inputs two simple lists of numbers. vecmul should multiply these lists element-wise as one would multiply vectors. Assume the two lists are of the same length. [For example, (vecmul '(2 3 4 5) '(1 4 5 2)) returns (2*1 3*4 4*5 5*2) or (2 12 20 10).] (5 Marks)2. Define function addvec and use vecmul to define a product function innpuch to find sum of the products, such as, (innprod '(1 2 3) '(7 8 9)) returns 1*7 + 2*8 + 3*9 or 50. (5 Marks)3. Define a function last1 which returns the last element of a list (at the top level) without making use of reverse or last (already built in to Common Lisp.) (5 Marks)4. Write a reverse function srev which reverses all lists that occur in an S-expression at any level. Thus (srev '((a b (c d)) e (f g))) should yield ((g f) e ((d c) b a)). (5 Marks)5. Write a function insert1 which takes its first integer argument and inserts it at the correct place in its second argument, a list of integers sorted in increasing order, so that (insert1 3 '(1 4 6 6 7)) produces (1 3 4 6 6 7). (5 Marks)6. Use insert to write a function sort1 which sorts a list of integers into increasing order. [We are done if the list is nil. Otherwise insert the car of the list into the sorted cdr]. (5 Marks)7. Define a function occurrence that takes a list and returns a list indicating the number of times each (eql) element appears, sorted from most common element to least common.(5 Marks)Example:(occurrences '(a b a d a c d c a)) ?((A 4) (C 2) (D 2) (B 1))8. Your friend is trying to write a function that returns the sum of all the non-nil elements in a list to help you to submit assignment on your behalf. He has written two versions of this function and neither of them work. Explain what is wrong with each, and give a correct version. (2?5 Marks)(1 nil 4 5 nil 8 9 nil nil) => 27(a) (defun summit (lst)(remove nil lst)(apply #'+ lst))(b) (defun summit (lst)(let ((x (car lst)))(if (null x)(summit (cdr lst))(+ x (summit (cdr lst))))))9. Suppose the function pos+ takes a list and returns a list of each element plus its position. (10 Marks)(pos+ '(7 5 1 4))? (7 6 3 7)Define this function using (a) recursion (b) iteration.
Discuss how the new technology works, what method or product the new technology is designed to replace, why the new technology is preferable to the old method or product, how this new technology benefits a print media corporation, the public, or both..
Describe the typical content of a fire safety training session for the employees State the purpose of a fire log book
Many notable characters, songs, and movies that were previously set to enter into the public domain have not as of yet due to repeated extensions of the copyright laws that have extended protections.
Write 200-250 words, examine how U.S. Constitution implements separation of powers and checks and balances. Describe why constitutional framers based new government on these ideas.
What are the similarities between Uniform Crime Reporting and National Incident-Based Reporting System ?
Calculate the maximum allowable internal pressure pmax based upon an allowable shear stress in the wall of the shell of 60 MPa. What is the change in wall thickness at this pressure? (E = 205 GPa, ν = 0.25)
Write a short essay opposing home schooling. Start with a debatable thesis statement. Include a paragraph acknowledging opposing views.
Assume the coefficient of friction between the pavement and tires is .3 and the alignment of this section of the road is horizontal. For this particular problem we can ignore the friction value and just use a standard deceleration rate of 11.2 ft/s..
Compare Egalitarian theory, Utilitarian theory and Libertarian theory in the distribution of resources. How does the concept different from the concept stated by the President's Commission in question 2?
Critically discuss the major factors contributing to prejudice and discrimination? What might we do to reduce the levels of hate that pervade our society?
Give a brief outline of Guthrie's ideas. Which ideas make the most sense to you and why?
A summary of the substance abusing high-risk family group, with explanation of the high-risk condition and associated behaviors or patterns.
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd