解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

解決済み


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://...

4年弱 前

解決済み


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

4年弱 前

解決済み


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

4年弱 前

さらに読み込む