6∧ᵇ32ₓ
Continue from Rearranging and transforming arrays.
ᵇ (Bitwise)In binary, the digit positions have values 1, 2, 4, and so on, counting from the right. The digits are 0 or 1, called bits. Six is binary 110 and three is 011. Bitwise applies a Boolean function separately to each bit. ∧ keeps a 1 only where both numbers have a 1, giving binary 010, or two:
⍭ (Primes)A prime is an integer greater than 1 divisible only by itself and 1. ⍭n gives the prime with n primes before it. ⍭0 is the prime 2:
On a prime, ⍭⁻ gives its position. It counts the primes strictly below its argument, including when the argument is not itself prime:
With a left argument, ⍭ performs another prime operation. With code 1 it tests whether a number is prime, and with code 2 it gives the next prime:
⨸ (Factors)A number’s prime factors are primes whose product is that number. Factors gives them in ascending order, with repetitions. Multiplying them recovers the number:
Factors’ inverse, ⨸⁻, multiplies a list of factors back into the number.
An exponent counts the copies of one prime factor in the product. With a left argument of ¯∞, Factors gives a table of distinct prime factors above their exponents:
⌻ (Polynomials)A polynomial is a sum of multiples of nonnegative integer powers of a variable, such as 1 + 2x + 3x². The multipliers 1 2 3 are its coefficients, starting with the constant term: the part without x. Binding these coefficients as the left argument of ⌻ makes a polynomial function:
∂ applies to this function too:
A root is an input where the polynomial is zero. With one argument, ⌻ gives the coefficient of the highest power and the approximate roots. For 2 − 3x + x², that coefficient is 1 and the roots are 1 and 2:
The inverse, ⌻⁻, rebuilds the coefficients from the highest-power coefficient and roots.
⇄ (Optimize)Optimize searches for the point where a function is least, starting from the right argument. The squared distance from 2 is least at 2:
With "solve":$t as the left argument, ⇄ instead searches for a zero. This finds the positive square root of 2, starting from 1: