Manipulability

~10 mincode completion

Implement manipulability(J) returning the scalar .

Examples

The stretched arm is singular: w = 0

Input
manipulability([[0, 0], [3, 2]])
Output
0

The L-shaped arm: w = 1

Input
manipulability([[-1, -1], [1, 0]])
Output
1

A diagonal Jacobian: w is the product of the gains

Input
manipulability([[2, 0], [0, 3]])
Output
6

Hints

Hint 1

Use a matrix product rather than nested loops, and check which operand transposes.

Hint 2

Watch for this: used det J which fails for non square jacobians.

Requirements

  • J: (m, n) Jacobian, m <= n

  • Return scalar w >= 0

Constraints

  • Allowed library: NumPy only

  • Time limit: 200 ms, Memory: 64 MB

Where this shows up

~10 min

6 employers weight this skill

4 autonomy companies, 2 defense companies. Top match scores 93.

Python
import numpy as np


def manipulability(J):
    """
    Yoshikawa manipulability sqrt(det(J J^T)).

    Args:
        J: (m, n) Jacobian, m <= n

    Returns:
        scalar w >= 0
    """
    # YOUR CODE HERE
    pass
Loading docs…

The AI Mentor needs an account

It reads your code and the failing tests and nudges you toward the fix without handing you the answer. Free accounts get it on every problem you're working on today.