# LISP minor assignment

i have a 2 small program due in a few hrs:

1. Write a procedure that computes elements of pascals triangle by means of a recursive proces. This must be written in Lisp, and show an inductive proof.

2. define (*a b)

(if (=b 0)

( +a (*a (-b 1)))))

This algorithm takes a number of steps that is linearin b. Suppose we include , together with addition, operations *double*, which doubles an integer and *halve,* which divides an ( even) integer by 2. Using these , design a multiplication procedure analagous to **fast-expt** that uses a logarithmic # of steps. SHow the code and inductive proof.

note: fast-exp procedure

(define ( fast-expt b n)

( cond (( = n 0) 1)

(( even? n) (square ( fast-expt b ( / n 2))))

( else ( * b ( fast-expt b ( - n 1 ))))))

## Deliverables

1 txt file is sufficient

## Platform

a text file application

Habilidades: Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software

Acerca do Empregador:
( 9 comentários ) United States

ID do Projeto: #2981571

## Premiar a:

if

See private message.

\$7 USD em 1 dia
(20 Avaliações)
4.3