Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python - cannot figure out this problem! Python - disregard the already typed in code, I could not figure the question out! De Moivre's Theorem

Python - cannot figure out this problem!
image text in transcribed
image text in transcribed
Python - disregard the already typed in code, I could not figure the question out!
De Moivre's Theorem states that for any real numbers x and n. (cosa + i sin x)" = cos no + i sin ng Here, refers to the imaginary number You already know that numbers of the form a+ib are called complex numbers, where a is the real part and is the imaginary part in Python complex is a built-in data type You can create a complex variable from two floats a and b via: C complex (a, b) where a is the real part and is the complex part Python also uses instead of to represent the imaginary number -2.1 complex (a,b) print (c) yields The code template below read in a single real number into the variable and a second (assumed positive) number into the variable Write a for loop that considers oll integer values n between 0 and N, and for each one, evaluates both the left hand and right hand sides of De Move's Theorem. For each past of the loop, print the current value of n and both the left hand and right hand values from the Theorem it will be helpful to format the output so that the two complex numbers have only two decimal places for each of the real and imaginary components Portunately , the format code (2}" works for complex vannblen the same as it does for floating points) For example, for inputs the should produce the code should produce 0.1.0040.00) 1.000.001 10.0741.001 0.071.00) 2 -0.9910.141 -0.99+0.14) 3 -0.21-0.98 -0.21-1).989 40.96-0.20 0.96-0.201 50.35+0.941 0.35+0.941 -0.91+0.419 -0.91*0.41) This of course illustrates the validity of De Moivre's Theorem for those particular values of x and in Abraham De Moivre, a French mathematician and a close friend of sac Newton was bom in 1667 in Champagne His eponymous, thecer first appeared in print in the year 1707 in the Philosophical Transactions number 309, vol. 25, pp 236 2371 LAB ACTIVITY 5.33 1. LAB De Moivre's Theorem 0/4 main.py Load del 1 from math inport sin cos 2 x Float(input()) 3 Nint(input) int edd. ist even: 7 Int 11 while (1) 1stdio.extinti) 2014 (2) 11 even 11) 13 14 i (110) 15 de 10 ) 18 System.out.print ce Develop mode Submit mode When done even your programes Submit for grading to the will your room for autoonding

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions

Question

1. Select the job or jobs to be analyzed.

Answered: 1 week ago