Solved


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 days ago

Solved


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

14 days ago

Solved


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

15 days ago

Solved


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

15 days ago

Solved


Roll the Dice!
Description Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. Example [x1,x2] = rollDice(...

15 days ago

Solved


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

15 days ago

Solved


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

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

16 days ago

Solved


Compute a sum
Write a function to compute the following sum Although a solution is available for general values of the coefficients, the co...

16 days ago

Solved


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

17 days ago

Solved


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.

20 days ago

Solved


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

20 days ago

Solved


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

22 days ago

Solved


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.

22 days ago

Solved


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

27 days ago

Solved


Compute a nested cube root
Consider the quantity . Write a function to compute without using loops or recursion.

27 days ago

Solved


Compute a sum of Ramanujan
Srinivasa Ramanujan defined the following function: Write a function to compute for various values of . See also Cody Proble...

27 days ago

Solved


Identify prime words

27 days ago

Solved


Find jumping medalists

28 days ago

Solved


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

28 days ago

Solved


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

29 days ago

Solved


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

1 month ago

Solved


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

1 month ago

Solved


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

1 month ago

Solved


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 ago

Solved


Differential equations I
Given a function handle |f| an initial condition |y0| and a final time |tf|, solve numerically the differential equation dy...

10 months ago

Solved


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

10 months ago

Solved


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

10 months ago

Solved


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

10 months ago

Solved


Lights Out 14 - 5x5, four 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...

10 months ago

Load more