Solved


Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

15 days ago

Solved


Remove the two elements next to NaN value
The aim is to *remove the two elements next to NaN values* inside a vector. For example: x = [6 10 5 8 9 NaN 23 9 7 3 21 ...

15 days ago

Solved


Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

15 days ago

Solved


Get the elements of diagonal and antidiagonal for any m-by-n matrix
In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

15 days ago

Solved


Create logical matrix with a specific row and column sums
Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...

15 days ago

Solved


intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identic...

15 days ago

Solved


Reverse Calculator
Use this reverse calculator and give correct output Its simple, In my Reverse calculator if you press 0 it will be considered...

15 days ago

Solved


Additive persistence
Inspired by Problem 2008 created by Ziko. In mathematics, the persistence of a number is the *number of times* one must apply...

15 days ago

Solved


Converting numbers back from extended form
Thanks for all the help you guys gave me on writing out the numbers in extended form in <http://www.mathworks.com/matlabcentral/...

15 days ago

Solved


Numbers in extended form
Shhhhhhh. Don't tell my daddy, but I'm borrowing his Cody account so all of you very smart people can help me out. I just star...

15 days ago

Solved


Ripping numbers apart!
So you have to "rip" a number apart into individual digits... The end output is a cell. That is if: x = 12345678 o...

15 days ago

Solved


Decode a simplified barcode
Given a bar code from this <http://www.mathworks.com/matlabcentral/cody/problems/602-make-a-simplified-bar-code exercise>: Re...

15 days ago

Solved


Make a simplified barcode
Given an integer to encode, make a barcode using the following encoding scheme: * The bar code is made from the binary versio...

15 days ago

Solved


Math with Roman Numerals
Given a function R within (+,-,*,/) and two Roman numerals a & b, compute aRb in Roman numerals.

15 days ago

Solved


Test if a Number is a Palindrome without using any String Operations
*Description* Given an integer _X_, determine if it is a palindrome number. That is, _X_ is equal to the _X_ with the digits ...

15 days ago

Solved


Increment a number, given its digits
Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

15 days ago

Solved


Split bread like the Pharaohs - Egyptian fractions and greedy algorithm
How would you split 5 loaves of bread among 8 people in all fairness? Get a hint from the Pharaohs. 5/8 = 4/8 + 1/8 , i.e. each ...

15 days ago

Solved


7 segment LED display
Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (see Wikipedia: http://e...

15 days ago

Solved


Convert Roman to Arabic Numerals
Based upon what I see on tv and at the movies, the use of Roman numerals indicates something is important or sophisticated (e.g....

15 days ago

Solved


Number of 1s in the Binary Representation of a Number
*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

15 days ago

Solved


N-th permutation.
Let write some permutations of positive integers. 1: 1 2 3 4 5 6 ... 2: 2 1 3 4 ... 3: 1 3 2 4 ... ...

17 days ago

Solved


Which permutation is it?
Let write some permutations of positive integers. 1: 1 2 3 4 5 6 ... 2: 2 1 3 4 ... 3: 1 3 2 4 ....

17 days ago

Solved


Possible Outcomes of American Roulette
The payout for American roulette can be calculated by: payout = (38/n)-1 where n is the number of squares the bet covers. ...

17 days ago

Solved


A (wrong) place for everything, and everything in its (wrong) place
You have an equal number of cups and balls, each labelled from one to N. You randomly place one ball in each cup. Determine th...

17 days ago

Solved


Numbered lottery balls into cells
You are running a lottery, and have a number of different balls numbered 1 to N. Your job is to figure out how many different w...

17 days ago

Solved


Put m balls into n boxes (again)
According to Cody Problem 1516, if I put 3 balls into 2 boxes then 1 1 1 1 1 2 1 2 2 ...

17 days ago

Solved


Put m balls into n boxes
Can you find all the cases where, if I put 3 balls into 2 boxes the case is 1 1 1 1 1 2 1 ...

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

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

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

17 days ago

Load more