Solved


How many ways to write a number
Given two positive numbers n and k, where n>=k. In how many ways can we write n as sum of k positive numbers. Same numbers but d...

5 years ago

Solved


Choose group with people
How many ways can you choose n groups of n people from n^2 people, assuming the groups are distinct? The number of people i...

5 years ago

Solved


odd number odd sum
How many three digit numbers are there whose sum of the digits is odd?

5 years ago

Solved


Rearrange string
Input is a given string. Output is the number of ways to rearrange the string.

5 years ago

Solved


house of cards
How many cards do one need to build a house of cards with n stages? Short explanation: /\ 2 cards for 1 stage ...

5 years ago

Solved


Rolling maximums above a threshold
You are given either a vector or a 2-D matrix M and a threshold value of t. Write a script that will calculate how many times t...

5 years ago

Solved


Approximate e
Given a and n, compute and approximation to f = a * e ^ n, without the use of exp, string operations, or floating point numbers....

5 years 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 ...

5 years ago

Solved


center of mass
R is a given matrix with size [n,2]. R(i,:) is interpreted as the 2D-position of a mass point with mass i. Calculate the center ...

5 years ago

Solved


attenuation
A beam of X-rays propagates a length d(1) through a medium with an attenuation coefficient alpha(1). After that the beam propaga...

5 years ago

Solved


Polygon division
Given the number of vertices (or sides), n, of a planar convex polygon, return the number of ways, w, in which you can divide th...

5 years ago

Solved


balance vector
Given a non-empty vector x with integer elements. x shall be called balance vector if one can split the elements of x into two g...

5 years ago

Solved


Babylonian method
Calculate the square root of a given positive number a using the Babylonian method (https://en.wikipedia.org/wiki/Methods_of_co...

5 years ago

Solved


Number construction I
Given a positive integer, n, return a, b, c and d, such that 1. n = a*sqrt(b)+c*sqrt(d) 2. a, b, c and d are all positive ...

5 years ago

Solved


solid of revolution
Given an real polynomial P and two real numbers a,b with 0<=a<=b. Calculate the volume of the solid of revolution made by rota...

5 years ago

Solved


Euler–Mascheroni constant
Approximate the Euler-Mascheroni constant using the series representation gamma_n=\sum_{k=1}^{n} [1/k-ln(1+1/k)] Calculat...

5 years ago

Solved


Number construction II
Given a positive integer, n, return a, b, c and d, such that 1. n = a*2^b+c*3^d 2. a, b, c and d are all positive integers...

5 years ago

Solved


fractal circles
Create a fractal with circles using the same process as the Sierpinski triangle (https://en.wikipedia.org/wiki/Sierpinski_trian...

5 years ago

Solved


Segmented number sequence
Given a positive integer, n, and a row vector, x, of positive integers, return a row vector, v, which is a sequence of length n ...

5 years ago

Solved


Juggler sequence revisited
This problem is related to <http://www.mathworks.com/matlabcentral/cody/problems/42835-return-the-sequence-element-ii Problem 42...

5 years ago

Solved


Increasing sub-sequence (Level 1)
Given a vector, v, of real numbers, return a positive integer, n, representing the longest contiguous increasing sub-sequence co...

5 years ago

Solved


Identify the sequence
Given a row vector, x, return 1 if it is an arithmetic series, or 2 if it is a geometric series. If it is neither, return 0. ...

5 years ago

Solved


Return the sequence element III
This problem is related to <http://www.mathworks.com/matlabcentral/cody/problems/42832-segmented-number-sequence Problem 42832>....

5 years ago

Solved


Wien's displacement law
Given the black body temperature (in *Celsius*), output the weavelength (in *meters*) at which the radiation peaks, according to...

5 years ago

Solved


Isothermal Expansion
Given the initial pressure and volume of an ideal gas, calculate the new volume, given the new pressure. Hint: <https://en.wi...

5 years ago

Solved


Lambert's W
Matlab cody does not support lambertw. Try to create a lambert's w function yourself. Lambert's W is the function that solves...

5 years ago

Solved


RGB to CMYK
Convert an RGB code to the corresponding CMYK code for printing. The RGB input is a [1×3] double array between 0 and 1. ...

5 years ago

Solved


Sum two real numbers
It seems easy, but... You cannot use +, -, plus, diff, cumsum, *, prod, times, etc.

5 years ago

Solved


Crunch that matrix!
You are given an M x N matrix. Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms ...

5 years ago

Solved


Frobenius McNugget Factorization
Mr. Frobenius McNugget is a peculiar man. As you might expect, he likes to eat Chicken McNuggets. But his love of number the...

5 years ago

Load more