Feeds
已解决
Break it up! Break it up!
You have N pennies. Write a Matlab script that will reveal how many different ways you can break up those pennies. For example...
8 hours 前
已解决
Guess the number I'm thinking of (Part 1)
In this game you are competing against two other people to guess the number that I'm thinking of. I randomly choose an integer ...
13 hours 前
已解决
Create a random vector of integers with given sum
Your task today is to write a function that returns a vector of integer numbers, between, and including, 1 and m, of which the s...
2 days 前
已解决
Generate a random matrix A of (1,-1)
Input n: is an positive integer which serves as the dimension of the matrix A; Output: A=(Aij),where each entry Aij is either...
3 days 前
已解决
Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...
3 days 前
已解决
Roll the Dice!
Description Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. Example [x1,x2] = rollDice(...
3 days 前
已解决
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...
3 days 前
已解决
Find primes and integers that solve an equation
Write a function to find all primes and non-negative integers that solve the equation where is an integer. If there are no...
3 days 前
已解决
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 days 前
已解决
Compute a sum
Write a function to compute the following sum Although a solution is available for general values of the coefficients, the co...
4 days 前
已解决
Compute the area of a Q
A figure resembling a Q (as in “quadrature”) is constructed in the following way: A right triangle is drawn with the left vertex...
5 days 前
已解决
Compute a sum involving the zeta function
Write a function to compute the sum for , where is the zeta function, the subject of Cody Problems 45939, 45988, and 45997.
8 days 前
已解决
Integrate a power tower
Write a function to compute this integral where . That is, the integrand is (x to the x) to the (x to the x) to the (x to the...
8 days 前
已解决
Count block fountains
A block fountain consists of rows of circles in which each row is a continuous block of circles (i.e., adjacent circles are tang...
10 days 前
已解决
Integrate a product of gamma functions
Write a function to compute the following integral: where and is the gamma function, the subject of Cody Problem 46025.
10 days 前
已解决
Set the Euler-Mascheroni constant with an identity using available MATLAB functions
Cody Problem <https://www.mathworks.com/matlabcentral/cody/problems/42826 42826> asked us to estimate the <https://en.wikipedia....
15 days 前
已解决
Compute a nested cube root
Consider the quantity . Write a function to compute without using loops or recursion.
15 days 前
已解决
Compute a sum of Ramanujan
Srinivasa Ramanujan defined the following function: Write a function to compute for various values of . See also Cody Proble...
15 days 前
已解决
Compute Khinchin's constant
Khinchin's constant K_0 = 2.684542001... (also written "Khintchine's constant") has the amazing property that it is the limiting...
16 days 前
已解决
Compute the nth Pythagorean prime
Pythagorean primes have the form p = 4n+1, where n is an integer, and they can be written as the sum of squares of two integers....
16 days 前
已解决
Five steps to enlightenment
This problem asks you to identify valid variations of the famous <https://en.wikipedia.org/wiki/Sum_and_Product_Puzzle sum and p...
18 days 前
已解决
Group-wise Euclidean distance
*Input*: * *x* —— An array of size *n-by-d*, where each row vector denotes a point in a d-dimensional space; * *g* —— A gro...
18 days 前
已解决
Easy Sequences 32: Almost Pythagorean Triples
An Almost Pythagorean Triple (abbreviated as "APT'), is a set of 3 integers in which square of the largest element, which we wil...
19 days 前
已解决
Steepest Descent Method
Write a function to find the values of a design variable vector, _x_, that minimizes an unconstrained scalar objective function,...
9 months 前
已解决
Differential equations I
Given a function handle |f| an initial condition |y0| and a final time |tf|, solve numerically the differential equation dy...
9 months 前
已解决
Monte-Carlo integration
Write a function that estimates a d-dimensional integral to at least 1% relative precision. Inputs: * d: positive integer....
9 months 前
已解决
Lights Out 15 - 5x5, broken buttons I
<https://en.wikipedia.org/wiki/Lights_Out_(game) Lights Out> is a logic game wherein all lights need to be turned off to complet...
9 months 前
已解决
Lights Out 13 - 5x5, three stages, x moves
<https://en.wikipedia.org/wiki/Lights_Out_(game) Lights Out> is a logic game wherein all lights need to be turned off to complet...
9 months 前











