in reply to Re: Expecting a 100 solutions, getting just 1
in thread Expecting a 100 solutions, getting just 1

There is randomness involved because 1 value of $A is a guess. The objective is to choose a pair of guesses A and B which minimize the error term. Also, will declaring the variables with my get around the scalar property of $? Thanks for the tip about the warnings.
  • Comment on Re^2: Expecting a 100 solutions, getting just 1

Replies are listed 'Best First'.
Re^3: Expecting a 100 solutions, getting just 1
by moritz (Cardinal) on Apr 17, 2012 at 09:10 UTC
    There is randomness involved

    Where? I don't see any calls to rand, or other sources of randomness in your code

    because 1 value of $A is a guess.

    A guess for what?

    The objective is to choose a pair of guesses A and B which minimize the error term.

    What's the error term? How is it calculated?

    Also, will declaring the variables with my get around the scalar property of $?

    No. You're not supposed to work around it, you are supposed to use variables starting with @ if you want multiple values in one variable.

      No. You're not supposed to work around it, you are supposed to use variables starting with @ if you want multiple values in one variable.

      Thanks for the clarification. I misused the term random in this case. The value of $A is a guess for a variable in a set of equations (which I didn't include here), uniformly distributed between 0 and A_max. The error term is "included" in the posted script as part of a comment.