Recall & Review
beginner
What is a complex type in R?
A complex type in R is a data type used to store numbers with both real and imaginary parts, like 3 + 2i.
Click to reveal answer
beginner
How do you create a complex number in R?
You can create a complex number by using the syntax:
complex(real = 3, imaginary = 2) or simply by writing 3 + 2i.Click to reveal answer
beginner
What function returns the imaginary part of a complex number in R?
The function
Im() returns the imaginary part of a complex number.Click to reveal answer
intermediate
What does the
Mod() function do with a complex number in R?The
Mod() function returns the modulus (or absolute value) of a complex number, which is the distance from zero in the complex plane.Click to reveal answer
beginner
How can you add two complex numbers in R?
You add two complex numbers just like regular numbers using the
+ operator, for example: (3 + 2i) + (1 + 4i).Click to reveal answer
Which of the following is a valid complex number in R?
✗ Incorrect
In R, complex numbers use 'i' for the imaginary part, so '5 + 3i' is correct.
What does the function
Re() return when used on a complex number?✗ Incorrect
Re() returns the real part of a complex number.How do you find the argument (angle) of a complex number in R?
✗ Incorrect
Arg() returns the argument (angle) of a complex number.What is the output of
Mod(3 + 4i) in R?✗ Incorrect
The modulus is sqrt(3^2 + 4^2) = 5.
Which function creates a complex number from real and imaginary parts in R?
✗ Incorrect
The
complex() function creates complex numbers from real and imaginary parts.Explain how to create and use complex numbers in R with examples.
Think about how you write complex numbers and how to get their parts.
You got /4 concepts.
Describe the functions used to get the modulus and argument of a complex number in R and why they are useful.
Consider the complex number as a point on a plane.
You got /4 concepts.