A résolu


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

7 mois il y a

A résolu


Make a Plot with Functions
Make a plot and test

8 mois il y a

A résolu


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

8 mois il y a

A résolu


Project Euler: Problem 4, Palindromic numbers
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 ...

9 mois il y a

A résolu


Highly divisible triangular number (inspired by Project Euler 12)
Triangular numbers can be calculated by the sum from 1 to n. For example, the first 10 triangular numbers are: 1, 3, 6, 10, ...

10 mois il y a

A résolu


Project Euler: Problem 16, Sums of Digits of Powers of Two
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^N? Thanks ...

10 mois il y a

A résolu


Sum of big primes without primes
Inspired by Project Euler n°10 (I am quite obviously a fan). With problem n°250 by Doug, you can find some global methods to co...

10 mois il y a

A résolu


Project Euler: Problem 11, Largest product in a grid
What is the greatest product of _k_ adjacent numbers in the same direction (up, down, left, right, or diagonally) in a _n×n_ gri...

10 mois il y a

A résolu


Sums of cubes and squares of sums
Given the positive integers 1:n, can you: 1. Compute twice the sum of the cubes of those numbers. 2. Subtract the square...

10 mois il y a

A résolu


Boustrophedon
Given a vector v and a positive integer n, return an m-by-n matrix containing the elements of v row-wise, alternating left-to-ri...

environ un an il y a

A résolu


Triangle Coordinates
Given a natural number n, return two -element vectors, x and y, containing the coordinates of a triangular arrangement of points...

environ un an il y a

A résolu


Create block matrix of integers (j+k-1) - Part II
Given m, n, p, and q, create an m-by-n matrix made up of submatrices, each sized p-by-q (if possible - the last row and column o...

environ un an il y a

A résolu


Dartboard Average II
A dartboard arranges the numbers 1 to 20 such that each value is typically flanked by quite different values - for example, 20 i...

environ un an il y a

A résolu


Wordle
Wordle is an english game where you need to guess a 5 letter word. For each guess you'll receive a feedback for the placement of...

environ un an il y a

A résolu


Create block matrix of integers (j+k-1) - Part I
Given m, n, p, and q, create a matrix of m-by-n blocks (submatrices), each sized p-by-q. The elements of the (j,k)th block all h...

plus d'un an il y a

A résolu


Dartboard Average I
A dartboard arranges the numbers 1 to 20 such that each value is typically flanked by quite different values - for example, 20 i...

plus d'un an il y a

A résolu


Split Even Number Into Two Primes
Given an even whole number n (> 2), return a 2-element vector of primes, p, such that p(1) + p(2) = n. Fun note: technically it...

plus d'un an il y a

A résolu


Determine if Input is Oddish or Evenish (Odd/Even Sum of Digits)
Given a positive integer n, determine whether n is "oddish" or "evenish" - that is, whether the sum of the digits of n is odd or...

plus d'un an il y a

A résolu


Create an arrow matrix
An arrow matrix is a square matrix that contains ones on the diagonal, the last column, and last row. ...

plus d'un an il y a

A résolu


Calculating Student Grades
The matrix grades contains raw grades for 7 students who took your course. Each row represents a different student. The first 7 ...

plus d'un an il y a

A résolu


Determine if x is a combination of m and n
Given positive integers x, m, and n, determine if x can be written as x = am + bn for any (non-negative) integers a and b. Your ...

plus d'un an il y a

A résolu


Dog Statistics
The vectors ht and wt contains the heights and weights of 20 golden retrievers. In some cases, it was not possible to make both ...

plus d'un an il y a

A résolu


Generate this matrix
Generate the following matrix. n = 2; out = [-4 -3 -2 -1 0 -3 -2 -1 0 1 -...

plus d'un an il y a

A résolu


Simpson's Paradox - Calculate correlation coefficients for groups of data
Simpson's Paradox is a statistical phenomenon where groups of data can have a characteristic while the whole data set together h...

plus d'un an il y a

A résolu


Find the minimum of the column-maximums of a matrix
Given a matrix A, find the maximum value of each column, then return the smallest of those maximum values (ie return the minimum...

plus d'un an il y a

A résolu


Calculate the mean of each half of a matrix
Given a matrix with an even number of columns, n, return a 1-by-2 row vector where the first element is the mean of all the elem...

plus d'un an il y a

A résolu


Find Closest Constant
Given a number x, return the value that is closest to x from this list of constants: 0, 1, , e, , (also known as ). For exampl...

plus d'un an il y a

A résolu


MatCAT - Reconstruct X from Its X-rays
Consider a matrix x x = [ 1 2 0 0 5 0 3 0 8 ] If we sum x along the rows we get row_sums = [3 5 11] ...

plus d'un an il y a

A résolu


Matrix Quadrants
Write a function that takes N as the input, and outputs a matrix whose upper-left (NxN) quadrant contains all ones, the lower-ri...

plus d'un an il y a

A résolu


letter yes yes & letter no no
Split a string into two strings, wherein the first string has all alphabetic letters and the second string has all the remaining...

plus de 3 ans il y a

Charger plus