0
votes

I have a function that defines a very long polynomial useful in operations with matrices.

The formula multiplies binomials of the form (1+xi*yj) , where i and j are subscripted and correspond to the rows and columns of the matrix in question, respectively. The polynomial that results is the product of all binomials with every permutation of i and j.

For example, a 3 x 2 matrix will have the polynomial product be:

(1+x1*y1)(1+x1*y2)(1+x2*y1)(1+x2*y2)(1+x3*y1)(1+x3*y2)

For clarification, every number after the variable should be treated as a subscript.

Is it possible for java to compute something of this massive amount, or can the task be delegated to another mathematics engine?

If possible, how would one go about implementing this?

1
Could you show what code you have so far for this case?null
This looks like an assignment that you are suppose to solveBlip
Since it's possible to write entire numerical analysis suites in Java, it's safe to say the answer is yes, it is possible in Java to compute something of this sort. Though you failed to give us an idea of the exact amount.biziclop
I do not how to to approach this problem, since eventually this problem will be extended to include up to 40 different variables all being tested against each other. I do know that if I create a polynomial involving simply 10 variables, the expression will be approximately 2^45 to 10^13 terms long. @biziclopChromatica
That is big, you'll need a lot of RAM for that :) In fact you'll need quite a lot of disk too and you probably want to distribute your calculation amongst several computers.biziclop

1 Answers

0
votes

Maybe this idea will help you to solve your problem:

    int result = 1;
    int x = 2;
    int y = 3;

    Integer [][] polynomials = new Integer[x][y];
    polynomials[0][0] = 1;
    polynomials[0][1] = 2;
    polynomials[0][2] = 3;
    polynomials[1][0] = 4;
    polynomials[1][1] = 5;
    polynomials[1][2] = 6;

    for(int i = 0; i<x; i++) {
        for(int j = 0; j<y; j++) {
            result *= (1 + polynomials[i][j]);
        }
    }
    System.out.println(result);