Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau.
Given a vector x, make an indexed pro...
casi 3 años hace
Resuelto
Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...
casi 3 años hace
Resuelto
Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...
casi 3 años hace
Resuelto
Kaprekar Steps
6174 is the Kaprekar constant. All natural numbers less than 10,000 (except some with same digits) can be reduced to 6174 in the...
casi 3 años hace
Resuelto
Scrabble Scores
Given a word, determine its score in <http://en.wikipedia.org/wiki/Scrabble Scrabble>.
The input string will always be provi...
casi 3 años hace
Resuelto
Summing digits
Given n, find the sum of the digits that make up 2^n.
Example:
Input n = 7
Output b = 11
since 2^7 = 128, and 1 + ...