Solved


distance between two points
compute distance between two points,where it is in Cartesian, Polar or Spherical coordinates.

11 years ago

Solved


Wheat on a chessboard pt 1
If a chessboard were to have wheat placed upon each square such that one grain were placed on the first square and each successi...

11 years ago

Solved


matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below. ...

11 years ago

Solved


Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.

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

11 years ago

Solved


Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10. For example, if you add the di...

11 years ago

Solved


Happy 2013...
Happy 2013, everyone! An interesting tidbit about 2013 is that it is the first year since 1987 to contain four different digits...

11 years ago

Solved


Coin Tossing: Probability of Same Heads for N tosses
A pair of physicists toss a coin n times each. What is the probability that they tossed the same number of heads? *Input:*...

11 years ago

Solved


What is the next step in Conway's Life?
Given a matrix A that represents the state of <http://en.wikipedia.org/wiki/Conway's_Game_of_Life Conway's game of Life> at one ...

11 years ago

Solved


Sum the elements in either diagonal of a square matrix
Sum the elements of a square matrix that lie on either the major diagonal or anti-diagonal.

11 years ago

Solved


Generate pi using logarithm
Generate pi using logarithm

11 years ago

Solved


Accessing elements on the diagonal
Access the diagonal elements of a matrix without 'diag' function

11 years ago

Solved


Decrypt Polybius
Decrypt Polybius square. Please refer to <http://www.mathworks.com/matlabcentral/cody/problems/1150-polybius-square Problem 11...

11 years ago

Solved


Polybius Square
Given a string, calculate the coordinates. Input will be always in lowercase. If string is a sentence then use 0 (zero) to indic...

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

11 years ago

Solved


Calculate Alcohol By Volume with Original and Final Gravity
Given an initial gravity of un-fermented wort (OG) and a final gravity of fermented wort (FG), better known as beer, it is possi...

11 years ago

Solved


Snakes on a plane
Given the dimensions of a 2-d plane, create a matrix where a "snake" of ones occupies the plane from top left to bottom right. ...

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

11 years ago

Solved


Project Euler: Problem 3, Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number being input, input might be ui...

11 years ago

Solved


Are you in or are you out?
Given vertices specified by the vectors xv and yv, and a single point specified by the numbers X and Y, return "true" if the poi...

11 years ago

Solved


Is the Point in a Triangle?
Check whether a point or multiple points is/are in a triangle with three corners Points = [x, y]; Triangle = [x1, y1; x...

11 years ago

Solved


Vector Linear sum: (p1-m1)V1+(p2-m2)V2+...(pK-mk)Vk
Calculate the sum of a Vector times coefficients expressed as two strings. Example: Normal representation [ a b c ], [ p1 ...

11 years ago

Solved


Volume difference between Ellipsoid and Sphere
Given an ellipsoid of semi principal axis (a,b,c) find the volume of the difference between this ellipsoid and the sphere with...

11 years ago

Solved


Get ranks of values in a vector
For a given vector, say [6 3 8 2], return the ranks (ascending) of observations, i.e. [3 2 4 1]. Do not worry about tied ranks. ...

11 years ago

Solved


Decimation
When dealing to the Roman Army, the term decimate meant that the entire unit would be broken up into groups of ten soldiers, and...

11 years ago

Solved


Circular Primes (based on Project Euler, problem 35)
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

11 years ago

Problem


Get ranks of values in a vector
For a given vector, say [6 3 8 2], return the ranks (ascending) of observations, i.e. [3 2 4 1]. Do not worry about tied ranks. ...

11 years ago | 2 | 51 solvers

Solved


Eliminate Polysyllabics: Long live short words!
Given a string s1, return s2 in which all the words with more than one syllable have been removed. To make things simple, we ...

11 years ago

Solved


Decrypt a secret message!
The crypto system in question is based on phone keyboard. We need two numbers in order to decrypt a word. First number represent...

11 years ago

Solved


Create a recurrence matrix for a vector of data
In <https://en.wikipedia.org/wiki/Conversation_analysis conversation analysis>, it's often useful to track the contributions fro...

11 years ago

Load more