Solved


If you prick us, do we not bleed?
While doing some quick sewing to fix up your child's Halloween costume, you accidentally jab your finger with the needle. Refle...

10 meses 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:*...

10 meses ago

Solved


Eliminate Outliers Using Interquartile Range
Given a vector with your "data" find the outliers and remove them. To determine whether data contains an outlier: # Identi...

10 meses ago

Solved


Coin change combinations.
Using only pennies (1), nickels (5), dimes (10), quarters (25), half dollars (50), and dollars (100), how many different combina...

10 meses ago

Solved


Test Driven Solution - Probability Problem 3
*Problem:* Without any Cody cheats, write code that passes the test suite. *Hint:* The test suite gets samples from the proba...

10 meses ago

Solved


Test Driven Solution - Probability Problem 2
*Problem:* Without any Cody cheats, write code that passes the test suite. *Hint:* The test suite gets samples from the proba...

10 meses ago

Solved


Test Driven Solution - Probability Problem 1
*Problem:* Without any Cody cheats, write code that passes the test suite. *Hint:* The test suite gets samples from the proba...

10 meses ago

Solved


Cumulative probability of finding an unlikely combination
This is a supplemental problem to the <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition CryptoMath> ...

10 meses ago

Solved


Guess the number I'm thinking of
In this game you are competing against two other people to guess the number that I'm thinking of. # I randomly choose an *i...

10 meses ago

Solved


Probability of red tulips (at both ends of a row)
I planted tulip bulbs in a row on my flower bed. I thought that I had planted white tulips all. However, later, it turned out t...

10 meses ago

Solved


Chess probability
The difference in the ratings between two players serves as a predictor of the outcome of a match (the <http://en.wikipedia.org/...

10 meses ago

Solved


Given n, create n random numbers such that their standard deviation is also n.
Given n, create n random numbers such that their standard deviation is also n.

10 meses ago

Solved


Rate of event occurence: find percentiles of the distribution (for smallish rates)
*In this problem you need to find the 5th and 95th percentiles of a Poisson distribution defined by parameter _μ_ (the mean rate...

10 meses ago

Solved


Simulating the selection of a state with given probabilities
Lets say we have 3 different states [1,2,3] with the probabilities of occurrences of each state is given as [0.5 0.2 0.3]. Which...

10 meses ago

Solved


What are the odds?
Two numbers, A and B are drawn randomly and uniformly on [-R,R]. What is the probability that A*B < A+B. Your function should ...

10 meses ago

Solved


Throwing Dice - Will You Be Eaten By The Dragon?
You and a dragon have agreed to let dice rolls determine whether it eats you or not. The dragon will roll a single die, of x ...

10 meses ago

Solved


Penny flipping - calculate winning probability (easy)
Two players are playing a fair penny flipping game. For each flip, the winner adds one penny from the loser's collection to his/...

10 meses ago

Solved


The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

10 meses ago

Solved


Calculate the probability that at least two people in a group share the same birthday.
Calculate the probability that at least two people in a group share the same birthday. Given an integer input n, return to 0.015...

10 meses ago

Solved


Probabilities - More brains than luck
This problem is related to <http://it.mathworks.com/matlabcentral/cody/problems/596-more-luck-than-brains Problem 596. More luck...

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

10 meses ago

Solved


Recaman Sequence - III
I want to create a Recaman sequence where there is a "1" in the n-th position. So from which integer should I start the Recaman ...

casi 2 años ago

Solved


remove single elements
Given a vector of integers, remove the elements that have appeared only once. The output elements should be in exact order as th...

casi 2 años ago

Solved


Max Change in Consecutive Elements
If an array is given as input then find the index of consecutive elements that represent maximum change. Example: Input ...

casi 2 años ago

Solved


expand intervals vol.3
This is the next problem after <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528> and <http://www.mathworks.co.u...

casi 2 años ago

Solved


expand intervals vol.2
Similar to problem <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528>. This is a more general case, when bounds ...

casi 2 años ago

Solved


expand intervals
You're given a row vector of an even number of monotonically increasing integers. Each pair of consecutive integers is the lower...

casi 2 años ago

Solved


compress sequence into intervals
You're given a row vector of monotonically increasing integers most of which are consecutive. Find the upper and lower bounds of...

casi 2 años ago

Solved


Tridiagonal
Return an n-by-n matrix that has a, b, c as the subdiagonal, main diagonal, and superdiagonal entries in the matrix. Example ...

más de 2 años ago

Solved


Another colon problem
This is simple problem based on problems 555, 801, 1118, etc. Create an index vector from two input vectors. Example: ...

más de 2 años ago

Load more