Skip to content

MultiplicativeEnergy ​

The number of quadruples (a1,a2,b1,b2)∈A×A×B×B(a_1,a_2,b_1,b_2)\in A\times A\times B\times B with a1b1=a2b2a_1b_1=a_2b_2.

MultiplicativeEnergy(A, B)E×(A,B)=#{(a1,a2,b1,b2):a1b1=a2b2}E^\times(A,B)=\#\{(a_1,a_2,b_1,b_2): a_1b_1=a_2b_2\}, the pairs of pairs with equal products.
MultiplicativeEnergy(A)E×(A,A)E^\times(A,A).
Typed signatures
TypePackageApplies
(collection, collection?) -> integercombinatoricsalways

Domain: Collections

Details
  • Defined in Epsil as ∑xr(x)2\sum_x r(x)^2, where r(x)r(x) is the number of pairs (a,b)∈A×B(a,b)\in A\times B with ab=xab=x: AdditiveEnergy with products for sums.
  • Zero is an ordinary member. It multiplies every member to 00, so all of those pairs share the one product, which contributes r(0)2r(0)^2: {0,1,2,3}\{0,1,2,3\} has r(0)=7r(0)=7.
  • The members are the distinct members of the collection, as in mathlib's Finset: a list's repeats are ignored, and a Set reads like a list.
  • Members must be exact rationals. A float, a symbol or an infinite collection leaves the call unevaluated.
  • A geometric progression has the energy of an arithmetic one of the same length: {1,2,4,8,16}\{1,2,4,8,16\} and {0,…,4}\{0,\dots,4\} both give 8585. The primes are a multiplicative Sidon set, by unique factorization.
  • Symmetric in its two arguments, and unchanged by scaling either set by a nonzero rational.
  • Not a Wolfram, SymPy or Sage head.

Examples

1 more kept as data, checked against the oracles
Basic #

the quadruples of {1,…,5}\{1,\dots,5\} with a1b1=a2b2a_1b_1=a_2b_2

live ↗
InMultiplicativeEnergy([1,2,3,4,5])\mathrm{MultiplicativeEnergy}(\bigl\lbrack1, 2, 3, 4, 5\bigr\rbrack)Out4949

powers of 3 multiply as their exponents add: {0,1,2}\{0,1,2\} and {0,1}\{0,1\}

live ↗
InMultiplicativeEnergy([1,3,9],[1,3])\mathrm{MultiplicativeEnergy}(\bigl\lbrack1, 3, 9\bigr\rbrack, \bigl\lbrack1, 3\bigr\rbrack)Out1010
Scope #

one member gives one quadruple, zero included

live ↗
InMultiplicativeEnergy([0])\mathrm{MultiplicativeEnergy}(\bigl\lbrack0\bigr\rbrack)Out11

no members, no quadruples

live ↗
InMultiplicativeEnergy([])\mathrm{MultiplicativeEnergy}(\bigl\lbrack\bigr\rbrack)Out00

exact rationals count too: {2−1,20,21}\{2^{-1},2^0,2^1\}

live ↗
InMultiplicativeEnergy([12,1,2])\mathrm{MultiplicativeEnergy}(\bigl\lbrack\frac{1}{2}, 1, 2\bigr\rbrack)Out1919
Properties #

zero multiplies every member to 00: those 77 pairs agree with each other, 727^2 quadruples, and the other nine pairs add 1515

live ↗
InMultiplicativeEnergy([0,1,2,3])\mathrm{MultiplicativeEnergy}(\bigl\lbrack0, 1, 2, 3\bigr\rbrack)Out6464

a geometric progression has the additive energy of {0,…,4}\{0,\dots,4\}, (2⋅53+5)/3(2\cdot 5^3+5)/3

live ↗
InMultiplicativeEnergy([1,2,4,8,16])\mathrm{MultiplicativeEnergy}(\bigl\lbrack1, 2, 4, 8, 16\bigr\rbrack)Out8585

unique factorization makes the primes a multiplicative Sidon set: 2⋅42−42\cdot 4^2-4

live ↗
InMultiplicativeEnergy([2,3,5,7])\mathrm{MultiplicativeEnergy}(\bigl\lbrack2, 3, 5, 7\bigr\rbrack)Out2828

a subgroup attains the maximum ∣A∣3|A|^3

live ↗
InMultiplicativeEnergy([−1,1])\mathrm{MultiplicativeEnergy}(\bigl\lbrack-1, 1\bigr\rbrack)Out88

swapping the two sets changes nothing

live ↗
InMultiplicativeEnergy([1,3],[1,3,9])\mathrm{MultiplicativeEnergy}(\bigl\lbrack1, 3\bigr\rbrack, \bigl\lbrack1, 3, 9\bigr\rbrack)Out1010
About
Examples11
Checked againstmathlib4 11 agree
Crosswalkmathlib4

Implementation

mappedmathlib4packages/oracle/src/mappings.ts

mathlib's energy is over Finsets, so each list is read as a Finset of rationals (duplicates collapse, as ours do)

mappedmathlib4packages/oracle/src/mappings.ts

mathlib's energy is over Finsets, so each list is read as a Finset of rationals (duplicates collapse, as ours do)

See also: AdditiveEnergy, Tally, Unique