Problem 44509. Determine if input is a valid AHP evaluation matrix
Input is a matrix. Output is a true or false statement (1 or 0). Return true if input is a valid Analytic Hierarchy Process evaluation matrix.
In a valid AHP matrix;
- All diagonal elements should be 1
- Lower triangular part should be element-wise reciprocals of upper triangular part
- Square matrix
For example
[ 1 2 1/2 1] - > True
[1 5 2 1 ] - > False
[1 5 1/5 2] - > False
Note: See test suite 19 for what is asked about rounding
Solution Stats
Problem Comments
-
3 Comments
Hello, Mehmet OZC. Could you please clarify the requirement "Lower triangular part should be inverse of upper triangular part"? This seems to require that lowerTriangular{input} = inverse{ upperTriangular{input} }. However, that appears to be impossible (except for an identity matrix), as the result of taking that inverse will itself be upper triangular. http://mathworld.wolfram.com/MatrixInverse.html . —DIV
it should be an element-wise inverse operation. For example a(3,2)=1/a(2,3) . Inverse operation with scalar values not with a matrix.
You can also search for "Understanding the Analytic Hierarchy Process"
OK. I've had a quick look at https://doi.org/10.1007/978-3-319-33861-3_2 . On page 10 they clarify that elements a(x,y) and a(y,x) must be the _reciprocal_ of one another. So that's fine. But I haven't encountered a description of such a relation as "element-wise inverse" — is it an expression commonly used in that field?
Solution Comments
Show commentsGroup

Probability & Stats
- 30 Problems
- 3 Finishers
- Don't be mean. Be nice!
- The Birthday Phenomenon
- Calculate the probability that at least two people in a group share the same birthday.
- The almost-birthday problem.
- Coin Tossing: Probability of Same Heads for N tosses
- Does the coin touch the line?
- Coin change combinations.
- Penny flipping - calculate winning probability (easy)
- German tank problem
- Unique dice configurations
- Throwing Dice - Will You Be Eaten By The Dragon?
- Probability of Choosing a Red Ball
- What are the odds?
- Simulating the selection of a state with given probabilities
- Generating random matrix with given probability mass function
- If you prick us, do we not bleed?
- Test Driven Solution - Probability Problem 1
- Test Driven Solution - Probability Problem 2
- Test Driven Solution - Probability Problem 3
- Probabilities - More brains than luck
- Compute Area from Fixed Sum Cumulative Probability
- Probability of red tulips (at both ends of a row)
- Cumulative probability of finding an unlikely combination
- Chess probability
- Guess the number I'm thinking of (Part 1)
- Eliminate Outliers Using Interquartile Range
- Histogram of histogram
- Given n, create n random numbers such that their standard deviation is also n.
- Mean = Standard Deviation
- Rate of event occurence: find percentiles of the distribution (for smallish rates)
Problem Recent Solvers92
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!