Solved

short or buy ? take the opportunity

you had already calculated a theoretical stock value, now you checked in bloomberg the quoted price of that stock and you have t...

1 year ago

Solved

Recursion at variable input

input of any length a =2 b =2 c =3 output = (a^b)^c = 64

1 year ago

Solved

currency converter

given a rate of exchange calculate the equivalent units of 100 USD

1 year ago

Solved

For a rectangle, if x is the length and 2x is width. Then find out x from the area of the rectangle?

For a rectangle, if x is the length and 2x is the width. Then find out x from the area of the rectangle? if the area is equal...

1 year ago

Solved

Create a constant offset.

Add a constant offset to an array. Example a = [1 3 5 9] offset = 2 y = [3 5 7 11]

1 year ago

Solved

Easy Sequences 23: Hat Guessing Game!

Consider the following Game Show: Hats, with numbers written on each, were placed on the heads of the participants. Participant...

1 year ago

Solved

Perimeter of a semicircle

Given the diameter d, find the perimeter of a semicircle

1 year ago

Solved

Easy Sequences 3: Prime 44-number Squares

The positive integers 62 and 238 are related. Their squares (3844 and 56,644) both end in '44'. In fact, 62 and 238 are the 3rd ...

1 year ago

Solved

Easy Sequences 1: Find the index of an element

The nth element of a series is defined by: . Obviously, the first element . Given the nth element , find the value of the corre...

1 year ago

Solved

Proper Factors

Generate the proper factors of input integer x and return them in ascending order. For more information on proper factors, refer...

1 year ago

Solved

Multiples of a Number in a Given Range

Given an integer factor _f_ and a range defined by _xlow_ and _xhigh_ inclusive, return a vector of the multiples of _f_ that fa...

1 year ago

Solved

Numbers with prime factors 2, 3 and 5.

Make a function which takes one positive integer n and returns a matrix with the numbers of the form (2^i)*(3^j)*(5^k) which are...

1 year ago

Solved

Matrix Construction I

Given n, construct a matrix as shown in the example below. Example For n=8, the output should look like this: 1 2 3 4 ...

1 year ago

Solved

Pascal's pyramid

In Pascal's triangle each number is the sum of the two nearest numbers in the line above: 1 1 1 ...

1 year ago

Solved

BULLSEYE Part 2: Reference Problem 18 BULLSEYE

Given n (always odd), return output a that has concentric rings of the 1s and 0s around the center point. Examples: Input ...

1 year ago

Solved

Toeplitz Matrix

For a given square matrix of order n-by-n check whether this is a Toeplitz matrix or not. Return true if it is.

1 year ago

Solved

Sorting integers by their digits (Level 1)

Given a vector, v, of positive integers, return a vector, w, by sorting v in ascending order, such that primary sorting is done ...

1 year ago

Solved

compress sequence into intervals

You're given a row vector of monotonically increasing integers most of which are consecutive. Find the upper and lower bounds of...

1 year ago

Solved

matrix zigzag

Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

1 year ago

Solved

Toeplitize a matrix

Similar to <http://www.mathworks.com/matlabcentral/cody/problems/3094-hankelize-a-matrix Problem 3094. Hankelize a matrix>, now ...

1 year ago

Solved

Hankelize a matrix

Similar to <http://www.mathworks.com/matlabcentral/cody/problems/42501-toeplitize-a-matrix Problem 42501. Toeplitize a matrix>, ...

1 year ago

Solved

Minimum of each diagonal

The well-known <http://www.mathworks.com/help/matlab/ref/min.html min> function can operate along either the rows or the columns...

1 year ago

Solved

Maximum of each diagonal

The well-known <http://www.mathworks.com/help/matlab/ref/max.html max> function can operate along either the rows or the columns...

1 year ago

Solved

Fill the matrix - 1

Input is a column vector and n. n columns will be added to the left of the input column. The first value of the row is the s...

1 year ago

Solved

Find the Final State of an Abelian Sandpile

Let us define an <http://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile Abelian sand pile> as a matrix that is only...

1 year ago

Solved

Matrix to 3-Column Matrix

Consider a matrix *A* such as A = [1 2 3 3 4 5 6; 2 3 4 5 6 7 8]; Can you convert this matrix to a three-column ...

1 year ago