Solved


Create a function that gives a matrix like the following
x=3 y= [1 -1 -1 0 1 -1 0 0 1]; -------------------------------- x=5 y= [ 1 -1 -...

4 days ago

Solved


Peg Solitaire - Apply Move
About Peg Solitaire . Previous Problem. Consider inital board; If we move the peg located on (4,6) to the left (4) directio...

4 days ago

Solved


Peg Solitaire - Get Possible Moves
About Peg Solitaire. Consider following initial board; (1) indicates there is a peg and (0) indicates empty holes. For thi...

4 days ago

Solved


MATLAB Basics: Complex Argument
For a given complex number, x, return the argument, y, in degrees.

4 days ago

Solved


MATLAB Basics: Complex Conjugates
For a given complex number, x, return the complex conjugate, y.

4 days ago

Solved


Pick the die most likely to win
After discussing Rock, Paper, Scissors, Lizard, Spock in The Simpsons and their Mathematical Secrets, Simon Singh writes that in...

4 days ago

Solved


MATLAB Basics: Complex Numbers
For a given complex number, x, return the real and imaginary parts as a vector, y = [Real Imaginary].

4 days ago

Solved


Convert Thermocouple output voltage (in mV) to Temperature (in C)
Convert Thermocouples of types (B,E,J,K,N,R,S,T) output junction voltage (in mV) to temperature (in C) using NIST coefficients r...

4 days ago

Solved


Compute a sum involving the totient over divisors of a number
Write a function to compute the following sum: where is the totient function. The sum is computed over the divisors of (inc...

4 days ago

Solved


The Piggy Bank Problem
Given a cylindrical piggy bank with radius g and height y, return the bank's volume. [ g is first input argument.] Bonus though...

4 days ago

Solved


Radioisotope Thermoelectric Generator (RTG)
Given an isotope's atomic mass (in amu), half-life (in years(a) or days(d)), and average kinetic energy absorbed (of emitted dec...

4 days ago

Solved


Nuclear Binding Energy
Compute the approximate nuclear binding energy in MeV using the least-squares fit of the semi-emirical mass formula. Round to th...

4 days ago

Solved


Matrix Indexing
Given a matrix A and scalars r,c,i, find the product of two elements, with the first element located at row r and column c (doub...

4 days ago

Solved


Matrix convolution
A certain convolution step involves an elementwise multipication between two 3x3 matrices and taking the resulting sum of the el...

4 days ago

Solved


Stacking vectors into a matrix
Given a 4x1 vector a, and a 2x2 matrix b, create a matrix M in which the first 2 rows are each identical to a and the last two r...

4 days ago

Solved


Logarithmically spaced vector creation using linspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Avoid using logspace and use the linsp...

4 days ago

Solved


Logarithmically spaced vector creation using logspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Use the logspace operator.

4 days ago

Solved


Vector creation using colon operator
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use the colon (:) operator.

4 days ago

Solved


Vector creation using linspace
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use linspace.

4 days ago

Solved


Right shift an array n times with constant space.
Right shift an array n times with constant space, that is, no extra array can be used. Right shift operation: Last element com...

4 days ago

Solved


Determine the average number of rounds for the following game.
Each round a uniformly distributed random number is picked between 0 and 1. The game ends when the sum of the random numbers is ...

4 days ago

Solved


Find the number of days in a given year
Given a year number (eg. 2000) as input, find how many days are there in the given year.

4 days ago

Solved


Solve an ODE: equation C
Write a function to solve the following ordinary differential equation: with and . The parameter is a constant. The functi...

4 days ago

Solved


Eliminate redundant numbers in text
Occasionally someone might write text such as Briefly explain one (1) common problem that can result from the constant use of ...

4 days ago

Solved


List the titles of Cody problems
Cody has several ways to list problems, but I have not yet found an easy way to list them by their numbers. Listing by date crea...

4 days ago

Solved


Make the first letter of a sentence Capital.
In this problem you will be given a string of 2 or 3 lines. Your work is to make the first letters of every line Capital. You wi...

4 days ago

Solved


Backgammon #1 - Pip Count
The following is a possible representation of a backgammon board: White stones are represented by positive integers Red stones ...

4 days ago

Solved


Redefine the Array if the Elements in the Array are Repeating
Check if the Array has any repeating elements, if there are repeating elements then choose "n" as a number of times you want tha...

4 days ago

Solved


Find all the indices when a value repetition occurs
Find all the sequences of consecutive repeated numbers in a numeric array, returning the indices where each sequence starts and ...

4 days ago

Load more