Solved


Elastic Collision 001: 1-D
Elastic Collision of two particles. <http://en.wikipedia.org/wiki/Elastic_collision wiki Elastic Collision> Solve Conservat...

3 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 ...

3 years ago

Solved


Find the jerk
No, it's not the author of this problem... Jerk is the rate of change in acceleration over time of an object. So, if given t...

3 years ago

Solved


Parallel vectors
Return true or false depending on whether 2 vectors are parallel or not. Vectors can be 2 or 3 dimensional. The origin is not c...

3 years ago

Solved


Slicing the cube
A bored matlab enthusiast has a cube with volume n^3. He decides to paint the entire surface of the cube red. Then, with slices...

3 years ago

Solved


distance to a straight line (2D) given any 2 distinct points on this straight line
Given 2 points P1,P2 on a straight line and a 3rd point, determine the distance of the 3rd point to the straight line. Your answ...

3 years ago

Solved


Kurchan 5x5 - Optimal Score
Related to Problems 1646 and 2650, but bigger. Technically, all you need to do for this Cody problem is input a 5x5 matrix conta...

3 years ago

Solved


Kurchan 4x4 - Optimal score
Related to Problem 1646, but bigger. Technically, all you need to do for this Cody problem is input a 4x4 matrix containing the...

3 years ago

Solved


Kurchan 3x3 - Optimal Score
Find an optimal 3x3 Kurchan square, score of 198. A 3x3 Kurchan square has values 1:9.The products of each row, column, diag...

3 years ago

Solved


Kurchan Square - Evaluation Function
Evaluate a Kurchan square. An NxN square with values 1:N^2. Given a square matrix determine the products of each row, column,...

3 years ago

Solved


Vector parallel to plane?
Given the coefficients of the equation which defines a plane as follows: ax+by+cz=d, return a boolean indicating whether the 2n...

3 years ago

Solved


rectangle in circle
In the figure below, the rectangle at the corner measures a cm x b cm. What is the radius of the circle in cm? <<http://www....

3 years ago

Solved


Do the line-segments intersect?
You are given two line segments. Do they cross? Consider one segment as (x1,y1) to (x2,y2), the other segment as (x3,y3) to (...

3 years ago

Solved


Identify Wagstaff primes
The numbers 3, 43, and 2731 are examples of <https://mathworld.wolfram.com/WagstaffPrime.html Wagstaff primes>. Write a func...

3 years ago

Solved


Next lexicographic - permutation
Find next lexicographic - permutation (permutations as it would occur in a dictionary order). E.g: nextP('ABCD') = ABDC If you...

3 years ago

Solved


Usage of java.math : N Choose K with unlimited precision
Calculate the binomial coefficient nchoosek with full accuracy. This challenge may use the wonderful word of java.math that allo...

3 years ago

Solved


Repopulate the City
For any population p of positive integers between pmin and pmax, we can calculate histogram count n for a list of evenly dividin...

3 years ago

Solved


Get ranking of a combination looking for speed.
I have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13]; They are then ordered from least to...

3 years ago

Solved


Get ranking of a combination
I have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13]; They are then ordered from least to...

3 years ago

Solved


Sleeping Queens 1
My youngest daughter received a card game named Sleeping Queens for Christmas this year, and has been playing it nearly non-stop...

3 years ago

Solved


Convert a vector into numbers
Suppose a vector x = [ 1 2 4 7] is given. You have to convert this vector into string number y = '1247'. Examples x = [ 1...

3 years ago

Solved


Count trailing zeros in a primorial
<https://www.mathworks.com/matlabcentral/cody/problems/44068-the-number-of-trailing-zero-digit-of-a-factorial Cody Problem 44068...

3 years ago

Solved


Exponents in Factorials
It's time to get excited about numbers!!! Well, we're just dealing with factorials here, but it's still a good reason to get ex...

3 years ago

Solved


Highest powers in factorials
This is the inverse of the problem <https://www.mathworks.com/matlabcentral/cody/problems/44747 Exponents in Factorials>. Inste...

3 years ago

Solved


Maximum sum from any 2 numbers with a variable number of inputs
Given a variable number of inputs, combine any 2 numbers from the inputs and output the maximum sum the combinations can generat...

3 years ago

Solved


Penny Flipping: Reverse subsets of a sequence of coins until you recover the original configuration
The original Penny Flipping Problem (PF-1) starts with a stack of N pennies arranged with all the coins heads up. The first oper...

3 years ago

Solved


Full combinations
Given n input vectors x1, x2, …, xn, generate a p*n matrix y whose rows contain all element-wise combinations of the vectors x1,...

3 years ago

Solved


Create all combinations of vectors
This function exists in the Neural Network Toolbox but is not available in Cody. Can you write such a function? See <http://...

3 years ago

Solved


Sum of combinations
Input: *X = 40*, *Y = [40 20 10 4]* Output: *Z = [1 0 0 0; 0 2 0 0; 0 1 2 0; 0 1 1 3; 0 1 0 5; 0 0 4 0; 0 0 3 3; 0 0 2 5; 0 ...

3 years ago

Solved


Lowest sum from a group of digits
Hi there. It's James's daughter here again, and my third grade math teacher is up to her old tricks. This time, she's giving u...

3 years ago

Load more