Log in

View Full Version : Imaginary numbers project java


mariazzzzz
Sep 17, 2016, 03:47 PM
You remember the imaginary number, I, right? You should also recall that i1=i, i2= ­1, i3= ­i, i4=1,


I


5=i, i6= ­1, i7= ­i, i8=1, and so on. Notice i5=i


.


This is because 5%4 = 1 (Modulus operation of 4


on the exponent 5 is 1). Similarly we see how the powers of I “cycle” around.


In this program, write a program where you take an exponent of I of your choosing (not the one I


use below in the example), perform a modulus operation on the exponent, and then outputs the


equivalent expression per the chart above.


For example, if I used i10, you would write a program that would output the following sentences:


“I am examining i to the power of 10.”


“The exponent “10” is 2 modulus 4.” (NOTE: Use the modulus operation on the exponent to get


the result of 2. Also note the quotation marks around the 10.)


THEN have your program print out the following sentences.


“If the modulus operation of 4 on the exponent of I is 1, then the result is “i”.”


“If the modulus operation of 4 on the exponent of I is 2, then the result is “­1”.”


“If the modulus operation of 4 on the exponent of I is 3, then the result is “­i”.”


“If the modulus operation of 4 on the exponent of I is 0, then the result is “1”.”


write a program where you take an exponent of i8

InfoJunkie4Life
Sep 17, 2016, 06:31 PM
Not big on doing your homework in these forums, however, if you give it a go there are plenty of persons who are willing to help you along...

Side note:

Imaginary numbers

i = sqrt{-1}

knowing this...

i^1 = i

i^2 = sqrt{-1} * sqrt{-1} = -1

i^3 = sqrt{-1} * sqrt{-1} * sqrt{-1} = -i

i^4 = sqrt{-1} * sqrt{-1} * sqrt{-1} * sqrt{-1} = 1

i^5 = sqrt{-1} * sqrt{-1} * sqrt{-1} * sqrt{-1} * sqrt{-1} = i

etc.

Modulus would be good way to find the remainder, to process higher powers of i.