The lisp function length counts

Assignment Help Basic Computer Science
Reference no: EM13164582

Write a function DOT-PRODUCT that takes two lists, each list has three numbers (elements), and produces the dot product of the vectors that they represent. For example,

-> (DOT-PRODUCT '(1.2 2.0 -0.2) '(0.0 2.3 5.0))

            -> 3.6

Write a function COUNT-NUMBER that counts the number of numbers that occur in a list. It should work like this:

-> (COUNT-NUMBER '(A 2.3 B 5 4.53 C F))

            -> 3

Write a function NEW-LIST that takes a number as its argument and constructs a list of that length containing all Ts. For example,

-> (new-lit 5)

-> (T T T T T)

The Lisp function LENGTH counts the number of elements in the top level of a list. Write a function ALL-LENGTH of one argument that counts the number of atoms that occur in a list at all levels.  Thus, the following lists will have the following ALL-LENGTHs.

(A B C)                                   => 3

            ((A (B C) D (E F))      => 6

            (NIL NIL (NIL NIL) NIL )   => 5

Reference no: EM13164582

Questions Cloud

Using java, design and implement an api euclidean graph : Using Java, design and implement an API EuclideanGraph for graphs whose vertices are points in the plane that include coordinates.
The class constructor should accept an array : Write a class named TestScores. The class constructor should accept an array of test scores as its arguments. The class should have a method that returns the average of the test scores. If any test score in the array is negative or greater than 10..
Opens an output file with the external name : Design an algorithm that does the following: opens an output file with the external name number_list.dat, uses a loop to write the numbers 1 through 100 to the file and then closes the file.
Devise a linear-time algorithm to count the parallel edges : Parallel edge detection: Devise a linear-time algorithm to count the parallel edges in a graph. Write the algorithm in pseudo-code.
The lisp function length counts : The Lisp function LENGTH counts the number of elements in the top level of a list. Write a function ALL-LENGTH of one argument that counts the number of atoms that occur in a list at all levels.  Thus, the following lists will have the following A..
In logicworks : In Logicworks, make a new design for an automobile third brake light. It will have 8 clock pulses (so use 3 D Flip Flops) and will sequence an LED stip of 15 red LED's as shown after each clock pulse. On the 7th clock pulse, the clock will become ..
What explicit statement is required in a set of ifrs : What explicit statement is required in a set of IFRS first-time adoption financial statements and explain whether and ABC, Inc. should present all of their statements of financial position using the new standard
Outline the design of a wireless network : Outline the design of a wireless network to support user mobility over a wide area. Include in your answer a discussion of addressing, routing and the used of fixed versus ad hoc network access nodes or base stations.
How are they recorded in last year accounts : Johnis a company director withundrawn wages-director feesfrom last year $108K and how are they recorded in last year accounts?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Determine integer to divide maximum number of partial sums

Now, given sequence, can you determine the integer M (L ≤ M ≤ U) which divides maximum number of partial sums of the sequence?

  Significant factors contributing to mmcc-s success

Write down most significant factors contributing to MMCC's success with its new, secure, self-managed network? Describe the reasons for your choices.

  Explain what is done to prevent wayward system administrator

Explain what can be done to prevent wayward system administrators from simply looking up user passwords in host machine password file?

  Solve reasoning problem

If Abby is communicating, so is Randy. Vijay and Kevin are either both communicating or neither is. If Heather is communicating, then so are Abby and Kevin. Describe your reasoning.

  Use a truth table to determine whether

Use a truth table to determine whether or not the following argument form is valid. You can  justify  your answer by doing the following: indicate which columns represent the premises and which represent the conclusion;

  Responsibility to maintain ethical standard in department

Do managers have a responsibility to maintain an ethical standard within a department? If so, how is the expected ethical standard established? How is it documented? How is compliance measured?

  Estimate for risk management in accompanying data

Estimate for risk management as shown in accompanying data, which vulnerability must be evaluated for additional controls first? Which one should be evaluated last?

  Describe how upper is adjusted to allow simpler code to work

Describe how A_upper is adjusted to allow this simpler code to work. (Hint: A_upper requires to be adjusted because A_lower will be sign-extended.)

  Why information technology is a business pressure

Explain in detail why Information Technology (IT) is a business pressure and also an enabler of response activities.

  Tools or tactics for risks for computing infrastructure

As part of project to assess security risks for computing infrastructure, you have found that other managers often have different idea. List any tools or tactics that could be used.

  Change arp entry in computer for mac address

Print your ARP cache table. Find a server on your local network. Change its ARP entry in your computer to point to your computer's MAC address. Print new ARP cache table. Now use the service and see what happens.

  Use electronic marketing resources-company-s stockholders

Your company can only afford to utilize three electronic marketing resources to accomplish these goals. Select three electronic marketing resources to use and justify each resource in memo to company's stockholders.

Free Assignment Quote

Assured A++ Grade

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!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd