Gelöst


Square a Number
Given an input x, return y, which is equal to the square of x.

14 Tage vor

Gelöst


Draw 'D'.
Draw a x-by-x matrix 'D' using 0 and 1. example: x=4 ans= [1 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0]

14 Tage vor

Gelöst


Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

14 Tage vor

Gelöst


Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

14 Tage vor

Gelöst


2 b | ~ 2 b
Given a string input, output true if there are 2 b's in it, false if otherwise Examples: 'Macbeth' -> false 'Publius Cornelius...

14 Tage vor

Gelöst


03 - Matrix Variables 2
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3b.png>> A 9x9 matrix of zeros, but with the following v...

14 Tage vor

Gelöst


03 - Matrix Variables 5
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3e.png>>

14 Tage vor

Gelöst


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?

14 Tage vor

Gelöst


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

14 Tage vor

Gelöst


Given a square and a circle, please decide whether the square covers more area.
You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

14 Tage vor

Gelöst


Height of a right-angled triangle
Given numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a...

14 Tage vor

Gelöst


frame of the matrix
Given the matrix M, return M without the external frame.

14 Tage vor

Gelöst


Find my daddy long leg (No 's')
Given the ratio of the two legs (longer / shorter), and the hypotenuse length, find the value of the bigger leg.

14 Tage vor

Gelöst


De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

14 Tage vor

Gelöst


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

14 Tage vor

Gelöst


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

14 Tage vor

Gelöst


Find out sum of all elements of given Matrix
Find out sum of all elements of given Matrix A=[1 2 3;4 5 6 ;7 8 9]; Answer must be: 45 *If you like this problem, pl...

14 Tage vor

Gelöst


Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

14 Tage vor

Gelöst


Inner product of two vectors
Find the inner product of two vectors.

14 Tage vor

Gelöst


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

14 Tage vor

Gelöst


Draw 'H'
Draw a x-by-x matrix 'H' using 1 and 0. (x is odd and bigger than 2) Example: x=5 ans= [1 0 0 0 1 1 0 0 0 1 ...

14 Tage vor

Gelöst


Temperature Conversion 2

14 Tage vor

Gelöst


Mass Conversion 1

14 Tage vor

Gelöst


Temperature Conversion 1

14 Tage vor

Gelöst


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

14 Tage vor

Gelöst


Area of a triangle
A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.

14 Tage vor

Gelöst


Given a matrix, swap the 2nd & 3rd columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

14 Tage vor

Gelöst


Create a Multiplication table matrix...
Create a product table in this format: P = [ 1 2 3 4 5; 2 4 6 8 10; 3 6 9 12 15; 4 8 12 1...

14 Tage vor

Gelöst


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

14 Tage vor

Gelöst


DNA N-Gram Distribution
Given a string s and a number n, find the most frequently occurring n-gram in the string, where the n-grams can begin at any poi...

14 Tage vor

Mehr laden