commodity risk management

Solved

Divisors of an integer

Given a number N, return a vector V of all integers that divide N. For example, N = 10 Then V=[1 2 5 10]

circa 7 ore ago

Solved

Count up then down

Create a function that produces counting up from 0 up to n then down to 0 n=2 --> 0 1 2 1 0 n=3 --> ...

circa 8 ore ago

Solved

Finding perimeter of a rectangle

A rectangle has a length of x centimeters and a width of w centimeters. Find the perimeter.

circa 8 ore ago

Solved

Matlab Basics - Rounding I

Write a script to round x DOWN to the next lowest integer: e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2

circa 8 ore ago

Solved

Number of digits in an integer

Specifies how many digits in a given integer. Example: in=100 ==> out=3

circa 8 ore ago

Solved

Vectorize the digits of an Integer

Create a vector of length N for an integer of N digits. x = 123045; x_vec = [1 2 3 0 4 5]; I happened upon a trick ...

circa 8 ore ago

Solved

Solving Quadratic Equations (Version 1)

Quadratic equations have the form: ax^2 + bx + c = 0. Example: x^2 + 3x + 2 = 0, where a = 1, b = 3, and c = 2. The equation has...

circa 9 ore ago

Solved

Coin change combinations.

Using only pennies (1), nickels (5), dimes (10), quarters (25), half dollars (50), and dollars (100), how many different combina...

4 giorni ago

Solved

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

5 giorni ago

Solved

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

6 giorni ago

Solved

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

7 giorni ago

Solved

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

8 giorni ago

Solved

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

8 giorni ago

Solved

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

9 giorni ago

Solved

Coin Tossing: Probability of Same Heads for N tosses

A pair of physicists toss a coin n times each. What is the probability that they tossed the same number of heads? *Input:*...

9 giorni ago

Solved

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

10 giorni ago

Solved

Calculate the probability that at least two people in a group share the same birthday.

Calculate the probability that at least two people in a group share the same birthday. Given an integer input n, return to 0.015...

11 giorni ago

Solved

Don't be mean. Be nice!

For this problem, you will be given a range of single digits R, and a separate number K. You job is to calculate the mean of al...

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

13 giorni ago

Solved

The Birthday Phenomenon

First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

14 giorni ago

Solved

Square the input

Given a scalar or vector x, return the square of each element. Example x = [7 2] answer = [49 4]

14 giorni ago

Solved

Positive Definiteness of a Matrix

Determine if input matrix is positive definite or not.

14 giorni ago

Solved

The glass half full

Identical glasses are placed in a triangular tower structure, such that the top level (L = 1) comprises one glass, the next leve...

15 giorni ago

Solved

Predicting life and death of a memory-less light bulb

*💡 💡 💡 💡 💡 💡 💡 💡 💡 💡 💡 💡 💡 💡 &...

15 giorni ago

Solved

Spot the First Occurrence of 5

This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...

15 giorni ago

Solved

Basic electricity in a dry situation

⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ &#...

15 giorni ago

Solved

Write c^3 as sum of two squares a^2+b^2

write c^3 as sum of two squares a^2+b^2. a and b must be integer and greater than zero. For example 5^3 = 2^2 + 11^2 5...

15 giorni ago

Solved

The Top 5 Primes

This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...

16 giorni ago

Solved

Divisible by n, Composite Divisors

Pursuant to <http://www.mathworks.com/matlabcentral/cody/problems/42453-divisible-by-n-prime-vs-composite-divisors Divisible by ...

20 giorni ago