Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Complex Numbers | Vectors
TEST R COURSE
course content

Зміст курсу

TEST R COURSE

TEST R COURSE

1. Basic Syntax and Operations
2. Vectors

Complex Numbers

Complex numbers are related to calculus and advanced math and widely used in quantum mechanics, signals processing, and physics.

Since this course aims to teach R basics, we will not dig deep into this subject but only consider this as one of the numerical types. Each complex number consists of real (let it be a) and imaginary (let it be b). Then the expression a+bi is called a complex number. i - is an imaginary unit such that i^2 = -1.

To create such a number in R, use the same denotation as above: a + bi. For example, we can create a complex number with the real part 5 and the imaginary part -3.

123
compl = 5 - 3i # Creating complex number compl # Output the number typeof(compl) # Output its type
copy

The output is:

You can perform arithmetic operations learned before with all the number types we have learned in this section.

Завдання

  1. Create integer number 20 assigned to variable num.
  2. Create a complex number with real part 10 and imaginary -5 assigned to variable compl.
  3. Perform the addition of num and compl assigned to variable res.
  4. Output the type of res.

Завдання

  1. Create integer number 20 assigned to variable num.
  2. Create a complex number with real part 10 and imaginary -5 assigned to variable compl.
  3. Perform the addition of num and compl assigned to variable res.
  4. Output the type of res.

The result has a "complex" type since the complex numbers are an extension field of the real numbers (and integers, respectively).

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 2. Розділ 3
toggle bottom row

Complex Numbers

Complex numbers are related to calculus and advanced math and widely used in quantum mechanics, signals processing, and physics.

Since this course aims to teach R basics, we will not dig deep into this subject but only consider this as one of the numerical types. Each complex number consists of real (let it be a) and imaginary (let it be b). Then the expression a+bi is called a complex number. i - is an imaginary unit such that i^2 = -1.

To create such a number in R, use the same denotation as above: a + bi. For example, we can create a complex number with the real part 5 and the imaginary part -3.

123
compl = 5 - 3i # Creating complex number compl # Output the number typeof(compl) # Output its type
copy

The output is:

You can perform arithmetic operations learned before with all the number types we have learned in this section.

Завдання

  1. Create integer number 20 assigned to variable num.
  2. Create a complex number with real part 10 and imaginary -5 assigned to variable compl.
  3. Perform the addition of num and compl assigned to variable res.
  4. Output the type of res.

Завдання

  1. Create integer number 20 assigned to variable num.
  2. Create a complex number with real part 10 and imaginary -5 assigned to variable compl.
  3. Perform the addition of num and compl assigned to variable res.
  4. Output the type of res.

The result has a "complex" type since the complex numbers are an extension field of the real numbers (and integers, respectively).

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 2. Розділ 3
toggle bottom row

Complex Numbers

Complex numbers are related to calculus and advanced math and widely used in quantum mechanics, signals processing, and physics.

Since this course aims to teach R basics, we will not dig deep into this subject but only consider this as one of the numerical types. Each complex number consists of real (let it be a) and imaginary (let it be b). Then the expression a+bi is called a complex number. i - is an imaginary unit such that i^2 = -1.

To create such a number in R, use the same denotation as above: a + bi. For example, we can create a complex number with the real part 5 and the imaginary part -3.

123
compl = 5 - 3i # Creating complex number compl # Output the number typeof(compl) # Output its type
copy

The output is:

You can perform arithmetic operations learned before with all the number types we have learned in this section.

Завдання

  1. Create integer number 20 assigned to variable num.
  2. Create a complex number with real part 10 and imaginary -5 assigned to variable compl.
  3. Perform the addition of num and compl assigned to variable res.
  4. Output the type of res.

Завдання

  1. Create integer number 20 assigned to variable num.
  2. Create a complex number with real part 10 and imaginary -5 assigned to variable compl.
  3. Perform the addition of num and compl assigned to variable res.
  4. Output the type of res.

The result has a "complex" type since the complex numbers are an extension field of the real numbers (and integers, respectively).

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Complex numbers are related to calculus and advanced math and widely used in quantum mechanics, signals processing, and physics.

Since this course aims to teach R basics, we will not dig deep into this subject but only consider this as one of the numerical types. Each complex number consists of real (let it be a) and imaginary (let it be b). Then the expression a+bi is called a complex number. i - is an imaginary unit such that i^2 = -1.

To create such a number in R, use the same denotation as above: a + bi. For example, we can create a complex number with the real part 5 and the imaginary part -3.

123
compl = 5 - 3i # Creating complex number compl # Output the number typeof(compl) # Output its type
copy

The output is:

You can perform arithmetic operations learned before with all the number types we have learned in this section.

Завдання

  1. Create integer number 20 assigned to variable num.
  2. Create a complex number with real part 10 and imaginary -5 assigned to variable compl.
  3. Perform the addition of num and compl assigned to variable res.
  4. Output the type of res.

The result has a "complex" type since the complex numbers are an extension field of the real numbers (and integers, respectively).

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 2. Розділ 3
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt