Solved


Gray code
Given a decimal number, convert it to its corresponding Gray code (see https://en.wikipedia.org/wiki/Gray_code). 8 -- 1100...

5 years ago

Solved


cofactor matrix
given a matrix, find its cofactor matrix <https://en.wikipedia.org/wiki/Minor_(linear_algebra)#Inverse_of_a_matrix>

5 years ago

Solved


find subscripts from linear index
a matrix and the linear index of an element is given as input. find the subscripts of that element. if linear index=3 , outp...

5 years ago

Solved


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

5 years ago

Solved


What is the current time in Darwin, Australia?
Traders need to track exchange calendars and trading hours in detail, and account for time zone differences and daylight savings...

5 years ago

Solved


Anagram
Given two strings, check whether they're anagrams to each other or not.

5 years ago

Solved


Maya - 03
Following up on the previous two problems, now you've to add or subtract two Maya numerals. The 3rd input will be a function ...

5 years ago

Solved


Maya - 02
<https://en.wikipedia.org/wiki/Maya_numerals> Prev. prob. - <https://www.mathworks.com/matlabcentral/cody/problems/45375-maya...

5 years ago

Solved


Maya - 01
Given a number, convert it into the Maya numeral system. <https://en.wikipedia.org/wiki/Maya_numerals> For example, n...

5 years ago

Solved


Maya long Count
Given a Mayan date, calculate the number of days after the end of the last Great Cycle. <https://en.wikipedia.org/wiki/Maya_c...

5 years ago

Solved


Seconds
Given the number of seconds after 12 am, find the time in the given format (12/24). If the format is not mentioned, use 24-ho...

5 years ago

Solved


Create matrix with common dates from a number of structs -inner join on dates
Do an "inner join" (as in SQL) on a number of structs where the ".date" is the date and the ".ts" the timeseries. The join is on...

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

5 years ago

Solved


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

5 years ago

Solved


Find the smallest integer m such that n divides m!
Write a function that takes an integer and finds the smallest integer whose factorial is divisible by . For example, if , then...

5 years ago

Solved


Extract leading non-zero digit (★★★★★)
(Copy of Problem 47) Benford's Law states that the distribution of leading digits is not random. This is probably because man...

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

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

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

5 years ago

Solved


Longest run of consecutive numbers (★★★★★)
(copy of Problem 672) Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you...

5 years ago

Solved


Fill a zeros matrix (★★★★★)
(Copy of Problem 830) The aim is to fill an array of all zeros given a numerical value and the index of row and columns for t...

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

5 years ago

Solved


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

5 years ago

Solved


PEMDAS 101
Return the following results for scalar values a,b,c,d.

5 years ago

Solved


the fly, the train, the second train, and their Zeno's paradox
*You have heard this one*: A train leaves station _A_ and travels with constant velocity _v1_. A second train leaves station _B_...

5 years ago

Solved


Function - Cylinder Surface Area
The goal

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

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

5 years ago

Load more