Problem 2405. The Number of Ways
Find all the possible ways to reach the end of a matrix. So given
[a b c d]
the possible ways [a c],[a d],[b c],[b d] as inputs p the number of rows and n the number of column. You will produce a matrix by using these two input inputs. The matrix starts with 1 and increases left to right. The last number in the matrix will be n*p. After that you find the possible ways to reach end of the matrix
Example 1
p = 2; the number of rows n = 2; the number of columns
will produce this output matrix
[1 2 3 4]
Possible ways are [1 3],[1 4],[2 3],[2 4]
output =
1 3 1 4 2 3 2 4
Example 2
p = 4; n = 2;
These produce the matrix
[1 2 3 4 5 6 7 8]
Possible ways are [1 3 5 7], [1 3 5 8],...,[2 4 6 8]
output = 1 3 5 7 1 3 5 8 1 3 6 7 1 3 6 8 1 4 5 7 1 4 5 8 1 4 6 7 1 4 6 8 2 3 5 7 2 3 5 8 2 3 6 7 2 3 6 8 2 4 5 7 2 4 5 8 2 4 6 7 2 4 6 8
Solution Stats
Problem Comments
Solution Comments
Show commentsGroup

Board Games II
- 14 Problems
- 10 Finishers
- High Precision Square Root (Inspired by Project Euler 80)
- Damping of Servomotors with Tachometer Feedback
- Find the right number make the equation
- Deriving a function using the difference quotient
- Fast 1-D Convolution (full shape)
- Fast 1-D Convolution (same shape)
- Fast 1-D Convolution (valid shape)
- Lambert's W
- First use of arrayfun() and anonymous function @(x)
- Cell Operator *
- Product of two multivariate polynomials
- Multivariate polynomials - convert monomial form to array
- Multivariate polynomials - overload multiplication
- Multivariate polynomials - emulate symbolic form
- Rewrite setdiff to account for non-unique values
Problem Recent Solvers37
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!