Jump to content

User:Darcourse/sandbox: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 507: Line 507:
==Random walks==
==Random walks==


A random walk on a 2d grid arrives at coordinate <math>(x,y)</math> after '''' steps, where
A random walk on a 2d grid arrives at coordinate <math>(x,y)</math> after '''' steps, where


:<math>R(x,y,z)=R(x-1,y,z-1)+R(x+1,y,z-1)+R(x,y-1,z-1)+R(x,y+1,z-1)</math>
:<math>R(x,y,z)=R(x-1,y,z-1)+R(x+1,y,z-1)+R(x,y-1,z-1)+R(x,y+1,z-1)</math>

Revision as of 15:55, 12 October 2024

Balancing a disc

Balancing a circle

Let the triple be the angle, distance and weight of a particle from the centre of the disc.

Let P be some particles on a unit disk such that a given diameter axis means that the sum of perpendiculars from P to is zero. Let be a distinct other axis with the same property.

Prove that all have this property.

Consider two axis orthogonal to each other and a set of weights with the above property (which can be achieved by calculating the position of the weight after the first weights have been placed).

Note that the perpendiculars to a new rotated orthogonal pair of axes from a given weight all lie on the circumference of the circle centred halfway between the origin and the weight, radius half the full distance from O to W.

This applies to each weight, and so there are a set of circles each with a common point on the circumference of the origin and the new axes intersect with these circles at the new distances.

From trigonometric identities, we have:

We know:

If is the original angle, and is the rotated amount, then we have:

and summing:

The resultant weighted vector at the origin is therefore zero, and this is invariant over axis rotation.

Or, the lines midway between two are balanced, and this process continues ad infinitum.

Convex function proofs

Consider , . Then:


Consider , . Then:

So need to prove:

or

or, dividing by :

So:

Catalan q-polynomials

The Catalan q-polynomials count the number of blocks present in the diagram under the diagonal height k, and start

The sum of the coefficients of give .

To generate the next level, we add a horizontal and vertical step. The horizontal step is always placed at the origin, and the vertical step can be placed anywhere off the bounding diagonal, and is the first time the path touches the diagonal.

The first path from the convolution is inserted along the (k-1)-th diagonal created by the two endpoints of the new steps, and the second is placed along the k-th diagonal.

With Dyck words, where the new template is , where is a Dyck word of length k. The X step is always first, and the Y step comes after a k-length Dyck word.

The new polynomial is therefore the heights of the previous polynomials, plus the rectangle created by the insertion.

For example, .

Cubic polynomial

Let

The local minima and maxima are given by the zeroes of the differential of .

If then (c is negative)

and means

Round Robin

6

  • 12 34 56
  • 13 26 45
  • 14 25 36
  • 15 23 46
  • 16 24 35

8

  • 12 34 58 67
  • 13 24 57 68
  • 14 25 36 78
  • 15 26 37 48
  • 16 27 38 45
  • 17 28 35 46
  • 18 23 47 56

GF for cubes

https://www.wolframalpha.com/input?i=%281%2B4x%2Bx%5E2%29%2F%281-x%29%5E4

The general relation is given by the Eulerian numbers.

Binomials

Prove

Consider

where

so

and

The meaning of logic

TRUTH

0000 (0) FALSE
0110 (6) XOR
1001 (9) NXOR
1111 (F) TRUE

IDEMPOTENT

0001 (1) AND
0011 (3) A
0101 (5) B
0111 (7) OR

INJECTIVE

0100 (4) LT
1100 (C) NB
1101 (D) LTE
1110 (E) NAND

SURJECTIVE

0010 (2) GT
1000 (8) NOR
1011 (B) GTE
1010 (A) NA

Partial sums of binomials

2.

GF for Catalan numbers

Catalan number

Start with the GF for the central binomial coefficient.

Integrating and setting the constant to from the case yields

Divide by x to get

Primitive roots

Primitive root modulo n

The order of an element is the smallest k where .

k divides . Testing a candidate against each possible k returns negative if and only if the candidate is a primitive root.

a/k 1 2 3 4 5 6
1 1 1 1 1 1 1
2 2 4 1 2 4 1
3 3 2 6 4 5 1
4 4 2 1 4 2 1
5 5 4 6 2 3 1
6 6 1 6 1 6 1

Fermat's theorem on sums of two squares

(5) can be proved by Euler's criterion. It also tells us that if ,

which is the sum of two squares by (1). (2), (3) and (4) can then be used to find it.

Finding primitive roots for primes

For each prime p of p-1, remove k^p from 1,..,p-1 as k runs over the same range. Only primitive roots remain.

Fermat's little power test

if and only if

For example, is never divisible by 13, 17, etc..., but is by 29.

Chinese Remainder Theorem

Say , and also with p,q primes, and a,b least residues.

Note that is and . Similarly is and .

Therefore and , and so

Plane partition GF

Plane partition

The GF is

Consider instead the much simpler GF of

The n-th term is the number of partitions of n into at least 0 parts + partitions of n-1 into at least 1 part + partitions of n-2 into at least 2 parts + etc...

Proof

The GF for at least k parts is

and

and we have counted the single x twice.

Coordinates of circumcentre

Let be coordinates . Then the midpoints of AB and AC are

The perpendiculars are

and the equations of the perpendiculars through the midpoints are

with equality when

so

and then

so

Graphs

Hamiltonian cycles

Hamiltonian cycles

Generate the permutations of all vertices. Remove all those with non-adjacent vertices.

Cuts

Two cuts are adjacent if the corresponding partitions differ by only 1 vertex.

Base conversion

An integer in base b can be written as

and the same integer in base d is

If , then the first equation becomes

Expand this using the binomial formula to get

and collect by like terms in d to get the second equation.

Add

We want to add two bytes A and B. We use auxiliary bytes C and D to store the carries and answer, and a carry flag for the final bits.

Let C be initially zero, and a,b,c,d be aligned bits.

Then and

where is XOR and c' is the next carry bit.

Jordan curve theorem

The Jordan curve theorem states that any line crosses a closed loop on a plane an even number of times, with tangencies counting twice.

Using the fundamental polygon, a similar result can be established for the torus and other surfaces.

This leads to the observation that a if a loop on a surface disconnects it, then it creates an inside and an outside. A loop that doesn't disconnect the surface doesn't.

Homotopy

If f and g are continuous functions on , let .

If x is fixed,

which is continuous as is constant.

If is fixed,

which is continuous because are.

Client-Vendor-Bank model

The Client-Vendor-Bank model (CVB) involves the oAuth model.

Only the Authentication and Authorization layers are used, along with vendorId and vendorSecret. These are registered with the Bank.

The steps involved are:

1. C sends V transaction request

2. V asks C for Authentication with vendorId and transaction details from B

3. B replies to V with the AuthCode for the transaction

4. V posts AuthCode, vendorId and vendorSecret to B

5. B commits the transaction and sends receipt to V

6. V sends receipt to C

This model has minimal external interference, and is secure as B has two potentially conflicting items for the same transaction.

Catalan interpretation

The 15 Bell numbers for n = 4 with the Catalan equivalent:

  • 1234 - (((())))
  • 1 234 - ()((()))
  • 2 134 - (()(()))
  • 3 124 - ((()()))
  • 4 123 - ((()))()
  • 12 34 - (())(())
  • 13 24 - crossed
  • 14 23 = ((())())
  • 12 3 4 - (())()()
  • 13 2 4 - (()())()
  • 14 2 3 - (()()())
  • 23 1 4 - ()(())()
  • 24 1 3 - ()(()())
  • 34 1 2 - ()()(())
  • 1 2 3 4 - ()()()()

Congruent number

The congruent number problem asks which square numbers are in an arithmetic progression of 3.

Are there higher powers such that 3 lie in an AP?

That is

or

so

Random walks

A random walk on a 2d grid arrives at coordinate after z steps, where

This leads to the definition