Menu

BinomialIdentity

Nicolas Hainaux
Attachments


This class is used to manipulate a particular kind of Expandables: (a+b)² = a² + 2ab + b², (a-b)² = a² -2ab + b² and (a+b)(a-b) = a² - b²
A BinomialIdentity is basically a Product of two Sums; but (a+b)×(a+b) will be displayed (a+b)² and (a-b)×(a-b) will be displayed (a-b)²
As well as for Expandables, it might well be that the exponent is assumed to always be Value(1). Maybe make it clear someday...

Possible args for __init__() :

  • another BinomialIdentity to copy
  • (Exponented, Exponented)

The first Exponented being a, the second being b
It will be automatically decided whether the BinomialIdentity will be (a+b)² or (a-b)² according to the sign of the second Exponented (b)
If 'squares_difference' is given as option in the same time, the BinomialIdentity will be created as a (a+b)(a-b); instead of (a±b)²

  • (RANDOMLY, <type>)

where <type> can be:
- 'sum_square' for (a+b)²
- 'difference_square' for (a-b)²
- 'squares_difference' for (a+b)(a-b) (name comes from a²-b²)
- 'any' for any of the previous types
- 'numeric_sum_square' or 'numeric_difference_square' or 'numeric_squares_difference' for a numeric version of all these

Fields :
a: (read-only) the first term
b: (read-only) the second term
kind: (read-only) the kind of BinomialIdentity, e.g. 'sum_square'|'difference_square'|'squares_difference'

Debugging info :

Check BinomialIdentity's complete doc

Back to Core Objects


Related

Doc for dev: Core Objects

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.