Solved


Toads and Frogs Puzzle 2
On a two-dimensional board with 2n + 1 rows and 2n + 1 columns, all (2n + 1)^2 positions of the board, except the central one, a...

8 years ago

Solved


Comparison of floating-point numbers (doubles)
<https://au.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html Floating-point numbers> cannot generally be repres...

8 years ago

Solved


Comparison of floating-point numbers (singles)
<https://au.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html Floating-point numbers> cannot generally be repres...

8 years ago

Solved


God of War: The Chains Of Olympus
The Spartan warrior, Kratos, is held by a chain of _n > 1_ links in the underworld. His only chance of survival is to break the ...

8 years ago

Solved


Let's Make A Deal: The Player's Dilemma 2
Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. Y...

8 years ago

Solved


Let's Make A Deal: The Player's Dilemma
Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. Y...

8 years ago

Solved


Find argmax of a function
You are given vectors x and y (=f(x)). Return the element of x for which f(x) is maximized.

8 years ago

Solved


Penny Distribution Machine
A machine consists of a row of boxes. To start, one places N pennies in the leftmost box. The machine then redistributes the pen...

8 years ago

Solved


Sherlock Holmes: The Spy Problem
A guest at a party is a spy if this person is not known by any other guest, but knows all of them. There is at most one spy at a...

8 years ago

Solved


Five Fingers
A little girl has just learnt how to count from 1 to N using the five fingers of her left hand as follows. She starts by calling...

8 years ago

Solved


The Google Interview: Two Eggs Problem
Consider the following problem, a popular Google interview question: A firm has invented a super-strong egg. For publicity pu...

8 years ago

Solved


007: Chinese Barrack Invasion
*MISSION:* Successfully invade a military barrack located in China. *WARNING:* There is a row of _n_ security switches protec...

8 years ago

Solved


Sort Reversal
There are n index cards in a row, with n distinct integers written on them (one number per card) so that the numbers are sorted ...

8 years ago

Solved


Toads and Frogs Puzzle
On a one-dimensional board with n + m + 1 cells, there are n counters in the first n cells representing Toads and m counters in ...

8 years ago

Solved


The Deadly Sin
Melvyn and Banner are fighting over chocolates. Melvyn has X chocolates, while Banner has Y. Whoever has a lesser number of choc...

8 years ago

Solved


Raise each element to the power of its index in a matrix
In a matrix, A = [1,2;3,4] raise the power of each element like: 1^1+2^3+3^2+4^4 and add it all to produce the result 274

8 years ago

Solved


Singular Value Decomposition
Calculate the three matrices of the singular value decomposition (A = U*S*V^T) for each provided matrix. U and V are square unit...

8 years ago

Solved


Hilbert numbers
Given a positive integer, n, return h as follows: 1. If n is not a <https://en.wikipedia.org/wiki/Hilbert_number Hilbert numb...

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

8 years ago

Solved


i forgot to use capital I
When referring to yourself you should write "I" (capital) and not "i". So correct the input string x, but be aware that other u...

8 years ago

Solved


Form a gaussian kernel using matrix size and sigma value
For example matrix = 3; sigma = 1.2; Gaussian kernel = [1 2 1; 2 2 2; 1 2 1]; ...

8 years ago

Solved


Temperature Conversion Utility
There are a few problems on Cody regarding temperature conversion (C to K, C to F, F to C), but none include Rankine. Furthermor...

8 years ago

Solved


volume of torus
Find volume of torus with a as major radius and b as minor

8 years ago

Solved


Find smallest number to leave a remainder of 1
given a vector of numbers, find the smallest number to be divisible by all of them with a remainder of 1. Note: input numbers wi...

8 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:*...

8 years ago

Solved


count any radix?
given radix r(2-9), digts d(1-4), give all possible strings in sorted order. for example, if r=2, d=2, then output {'00' '01' '1...

8 years ago

Solved


Probability of Choosing a Red Ball
Given two jars of red and blue balls, find the probability of choosing a red ball from Jar 1 after going through the steps. ...

8 years ago

Solved


Forward Elimination for Gauss Elimination
Perform forward elimination for a given pivot column in the augmented matrix, Ab=[A,b]

8 years ago

Solved


Divide polynomial p1 by p2.
Divide polynomial p1 by p2 given as vectors. Return result q and r vectors which corresponds the quotient and remainder of divis...

8 years ago

Solved


Sum of big primes without primes
Inspired by Project Euler n°10 (I am quite obviously a fan). With problem n°250 by Doug, you can find some global methods to ...

8 years ago

Load more