Problem


Maximizing Stock Profit
As a stock exchange broker focusing on a single transaction, your goal is to maximize profit by buying a stock at a low price an...

mehr als 2 Jahre vor | 0 | 24 Lösungsvorschläge

Gelöst


Calculo das raizes com Bhaskara
Dado três valores a, b e c. Calcule as raizes da equação ax² + bx + c = 0 * para raizes reais, deve ser arrendondado em 2 casas...

mehr als 2 Jahre vor

Gelöst


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

mehr als 2 Jahre vor

Gelöst


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

mehr als 2 Jahre vor

Gelöst


Place numbers
Given two input first input is a matrix which consist of the index numbers of the second input vector. You place the second inpu...

mehr als 2 Jahre vor

Gelöst


Least Absolute Deviations (L1-norm) line fit - degree 1
Matlab's polyfit function is very handy to find least-squares regression. It minimizes the (L2-norm) of the estimation errors, b...

mehr als 2 Jahre vor

Gelöst


Minimize a quadratic function
Write a function to minimize the function . The coefficients a, b, and c will be positive. Give the coefficients in a vector coe...

mehr als 2 Jahre vor

Gelöst


Center of Mass(es) in 3D Space
Given a matrix of format [x1,y1,z1,m1; x2,y2,z2,m2 . . .], return the center of mass of all listed points in 3d space [xc,yc,zc]...

mehr als 2 Jahre vor

Gelöst


Count of Unique Elements of a Vector
Count the number of times each unique element appears in a vector. Example: Input x = [2 9 1 2 4 9 2] Output y = [1 1; 2 3; 4...

mehr als 2 Jahre vor

Gelöst


Approximation of an integral - Riemann sum
Riemann sum is a certain kind of approximation of an integral by a finite sum. In this problem, I want you to use Midpoint Riem...

mehr als 2 Jahre vor

Gelöst


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

mehr als 2 Jahre vor

Gelöst


Find matching string from a list of strings
Write a function that returns a string that is a unique match (if it exists) of the string inStr from a list of strings strList....

mehr als 2 Jahre vor

Problem


Hofstadter Q sequence
The Hofstadter G sequence is defined as follows: The first elements of the sequence are 1, 1, 2, 3, 3, 4, 5, 5, 6, 6. Write ...

mehr als 2 Jahre vor | 2 | 33 Lösungsvorschläge

Problem


Hofstadter Female and Male sequences
The Hofstadter Female (F) and Male (M) sequences are defined as follows Write a function to compute for a given n. See http...

mehr als 2 Jahre vor | 1 | 13 Lösungsvorschläge

Problem


Hofstadter H sequence
The Hofstadter G sequence is defined as follows: The first elements of the sequence are 0, 1, 1, 2, 3, 4, 4, 5, 5, 6. Write ...

mehr als 2 Jahre vor | 0 | 13 Lösungsvorschläge

Problem


Hofstadter G sequence
The Hofstadter G sequence is defined as follows: The first elements of the sequence are 0, 1, 1, 2, 3, 3, 4, 4, 5, 6. Write ...

mehr als 2 Jahre vor | 0 | 15 Lösungsvorschläge

Gelöst


Generate the Figure-Figure sequence
After discussing Scott Kim’s FIGURE-FIGURE Figure (below) in Gödel, Escher, Bach, Douglas Hofstadter introduced an integer seque...

mehr als 2 Jahre vor

Problem


Stern-Brocot Sequence
The Stern-Brocot diatomic sequence is defined as follows: The first elements of the sequence are 0, 1, 1, 2, 1, 3, 2, 3, 1, 4...

mehr als 2 Jahre vor | 1 | 13 Lösungsvorschläge

Problem


Interval Compression
Given a set of integers, the task is to create a list of closed intervals where each interval includes its endpoints. For exampl...

mehr als 2 Jahre vor | 1 | 14 Lösungsvorschläge

Problem


Final Stone Weight
You are given an array with weights of stones. The objective is to determine the weight of the final stone remaining after all c...

mehr als 2 Jahre vor | 2 | 18 Lösungsvorschläge

Gelöst


Circular Primes (based on Project Euler, problem 35)
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

mehr als 2 Jahre vor

Gelöst


Make a 1 hot vector
Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

mehr als 2 Jahre vor

Gelöst


Finger Counting
Just counting numbers using fingers. First all my ten fingers are closed. I will say 1 and open my one finger. Likewise for 6...

mehr als 2 Jahre vor

Gelöst


Remove DC
Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component. Examp...

mehr als 2 Jahre vor

Gelöst


2 b | ~ 2 b
Given a string input, output true if there are 2 b's in it, false if otherwise Examples: 'Macbeth' -> false 'Publius Cornelius...

mehr als 2 Jahre vor

Gelöst


Cumulative difference
Given an array, return the cumulative difference. Example a = [ 1 3 5 7 ] cumdiff = [ 1 2 1 -2 ]

mehr als 2 Jahre vor

Gelöst


Space Saver
Remove all characters that are below a space in ASCII value.

mehr als 2 Jahre vor

Gelöst


All your base are belong to us
Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

mehr als 2 Jahre vor

Gelöst


Who is the baby and who is the daddy in this family?
Given an array of numbers that shows the characteristcs of all family members, find who is the baby and who is daddy in this fam...

mehr als 2 Jahre vor

Gelöst


interesting center of magic matrix
output the centre of magic matrix of n input=7; output=25

mehr als 2 Jahre vor

Mehr laden