已解决


Monte-Carlo integration
Write a function that estimates a d-dimensional integral to at least 1% relative precision. Inputs: * d: positive integer....

4 years 前

已解决


Integer sequence - 2 : Kolakoski sequence
Get the n-th term of <https://oeis.org/A000002 Kolakoski Sequence>.

4 years 前

已解决


Alternating sum
Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

4 years 前

已解决


Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
Given a number _n_, return the terminal value of the number chain formed by summing the square of the digits. According to the P...

4 years 前

已解决


"Look and say" sequence
What's the next number in this sequence? * [0] * [1 0] * [1 1 1 0] * [3 1 1 0] * [1 3 2 1 1 0] This a variant on the w...

4 years 前

已解决


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

4 years 前

已解决


Sum the Infinite Series
Given that 0 < x and x < 2*pi where x is in radians, write a function [c,s] = infinite_series(x); that returns with the...

4 years 前

已解决


Convert this color - RGB Vector to Hex String
Given a 3 element RGB vector corresponding to a color (given by the MATLAB color spec <http://www.mathworks.com/help/matlab/ref/...

4 years 前

已解决


Convert hex color specification to MATLAB RGB
Here's something that comes up all the time if you deal with web pages. Given a <http://www.w3schools.com/html/html_colors.as...

4 years 前

已解决


Successive zeros
Suppose n is the number of digits a number contains. Now, 12032 - is a valid n=5 digit number. But 10023 - is defined as i...

4 years 前

已解决


Successive zeros (harder)
The problem is from Problem 45436, <https://www.mathworks.com/matlabcentral/cody/problems/45436-successive-zeros> Suppose n i...

4 years 前

已解决


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

4 years 前

已解决


The almost-birthday problem.
This is a harder version of the birthday problem. Now, you will have to determine the probability that two or more people in a r...

4 years 前

已解决


Mean = Standard Deviation
Create a series with following properties; # All of the members should be positive integer # Mean of the series should be in...

4 years 前

已解决


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

4 years 前

已解决


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

4 years 前

已解决


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/...

4 years 前

已解决


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

4 years 前

已解决


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

4 years 前

已解决


Histogram of histogram
Histogram of histogram (HoH) is a useful measure concerning the distribution of random data, which has diverse applications in d...

4 years 前

已解决


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.

4 years 前

已解决


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

4 years 前

已解决


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

4 years 前

已解决


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

4 years 前

已解决


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

4 years 前

已解决


Generating random matrix with given probability mass function
Inspired by <http://www.mathworks.com/matlabcentral/cody/problems/2356-simulating-the-selection-of-a-state-with-given-probabilit...

4 years 前

已解决


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

4 years 前

已解决


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

4 years 前

已解决


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

4 years 前

已解决


Unique dice configurations
Given a number of dice N and the number of sides on each die S, write a MATLAB function that will output how many unique permuta...

4 years 前

加载更多