Risolto

Return fibonacci sequence do not use loop and condition

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: ...

11 mesi fa

Risolto

Find the next Fibonacci number

In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

11 mesi fa

Risolto

Fibonacci sequence

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

11 mesi fa

Risolto

Return the Fibonacci Sequence

Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

11 mesi fa

Risolto

Solve a System of Linear Equations

Example: If a system of linear equations in x₁ and x₂ is: 2x₁ + x₂ = 2 x₁ - 4 x₂ = 3 Then the coefficient matrix (A) is: 2 ...

11 mesi fa

Risolto

Swap the first and last columns

Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

11 mesi fa

Risolto

Sum of series

a(n) = n^2 - (n-1)^2 find the summation of the series upto n i.e. a(1)+a(2)+...+a(n)

11 mesi fa

Risolto

Calculate Amount of Cake Frosting

Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

11 mesi fa

Risolto

Verify Law of Large Numbers

If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

11 mesi fa

Risolto

Sum of series VII

What is the sum of the following sequence: Σ(km^k)/(k+m)! for k=1...n for different n and m?

11 mesi fa

Risolto

Sum of series VI

What is the sum of the following sequence: Σk⋅k! for k=1...n for different n?

11 mesi fa

Risolto

Sum of series V

What is the sum of the following sequence: Σk(k+1) for k=1...n for different n?

11 mesi fa

Risolto

Sum of series IV

What is the sum of the following sequence: Σ(-1)^(k+1) (2k-1)^2 for k=1...n for different n?

11 mesi fa

Risolto

Sum of series III

What is the sum of the following sequence: Σ(2k-1)^3 for k=1...n for different n?

11 mesi fa

Risolto

Sum of series I

What is the sum of the following sequence: Σ(2k-1) for k=1...n for different n?

11 mesi fa

Risolto

Sum of series II

What is the sum of the following sequence: Σ(2k-1)^2 for k=1...n for different n?

11 mesi fa

Risolto

Vector creation

Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

11 mesi fa

Risolto

Doubling elements in a vector

Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

11 mesi fa

Risolto

Flip the vector from right to left

Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

11 mesi fa

Risolto

Whether the input is vector?

Given the input x, return 1 if x is vector or else 0.

11 mesi fa

Risolto

Get the length of a given vector

Given a vector x, the output y should equal the length of x.

11 mesi fa

Risolto

Dimensions of a rectangle

The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

11 mesi fa

Risolto

Area of an Isoceles Triangle

An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<https://imgur...

11 mesi fa

Risolto

Is this triangle right-angled?

Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

11 mesi fa