Summary of problems solved by SiC exercises (1.40)

Source: Internet
Author: User

Exercise 1.40 is a simple question, but it looks complicated. In essence, it is actually a simple question.


The original question is as follows:

Define a procedure cubic, Which is used together with the newtons-method procedure in the following form expression:

(newtons-method (cubic a b c) 1)

Cubic Equation


.


The question is very simple. We need to create a cubic process, but it involves the zero points of newtons-method and cubic equation. If you only read the question, you really don't know where to start.


To complete this question, first go back and repeat newtons-method in the book. newtons-method in the book is defined as follows:


(define (newtons-method g guess)  (fixed-point (newton-transform g) guess))



In fact, it is to find the fixed point of newton-transform.


So what is the newton-transform?


The definition of newton-transform in the book is as follows:


(define (newton-transform g)  (lambda (x)    (- x (/ (g x) ((deriv g) x)))))



Its function is to obtain f (x), so that f (x) is as follows:

F (x) = x-g (x)/Dg (x)



As described in section 1.3.4 of the book when introducing the Newton method:


If x-> g (x) is a microfunction, then a solution of the equation g (x) = 0 is a fixed point of the Function x-> f (x, f (x) = x-g (x)/Dg (x)


Okay. Back to our question, we have a function.

G (x) =


We need to push the zero point of the function g (x), that is, a solution for g (x) = 0.

As described above, it is our requirement (newtons-method <g (x)> 1). Note that this is not a legal Scheme statement.


Here g (x) is the return value of the cubic process we want to do.


The problem becomes simple here, but it is just a lambda process that uses the cubic process to generate a cubic equation. The cubic process is defined as follows:

(define (cubic a b c)   (lambda (x)    (+ (* x x x) (* a x x) (* b x) c)))

Is the result a little unexpected and simple?




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.