2017年7月28日金曜日

Fusion tree

Mantra in computer science is very complicated.

A fusion tree is a tree data on w-bit integers. It uses O(n) space and performs searches in O(logw n) time, which is faster than the van Emde Boas tree. O(1) is the fastest (MSB).


Sketching is the method by which each w-bit key at a node containing k keys is compressed into only k − 1 bits. The node X are 0,1,2・・・・,(n-1).

This is expansion.

O(n^2)


The fusion tree must be able to search a node containing up to w^1/5 keys in constant time.
There are many start points Xo. It includes (0,1) which is 2^(n-1) bits, but you can search it according to w and Xn. Therefore, you can find max() min(), and successor(x) predecessor(x). X(1) survive.

The computer like copying.

1000000000100000000・・・・
1000100000110000000・・・・
1000010000111000000・・・・
1000000100111100000・・・・

You want to know 100,110,111 for comparison.


empty() is S=φ

delete(x) is setting the bit for x to 0.

There is the collapse.



Each sketch bit in location bi will get shifted to bi + mi.



bi + mj are distinct for all pairs (i, j). This will ensure that the sketch bits are uncorrupted by the multiplication. bi + mi is a strictly increasing function of i. The order of the sketch bits is preserved. The sketch bits can be packed into a range of size at most r^4

2017年7月27日木曜日

Y-fast trie

ordered dictionary


successor(x) returns the smallest element of S greater than x, ①=1
x000①0|
(⇒)

predecessor(x) returns the largest element of S smaller than x, ①=1
|010①0x
(⇒)



An X-fast Trie is a binary trie where leaves are stored in a doubly-linked list and where all nodes in each level are stored in a hash table. It is O(1).

The successor(x) is O(log log U).

You add new nodes to the trie and update thread pointers to include x.


Y-fast trie has predecessor or successor queries in O(log log U) by using O(n). It contains at least (log U)/4 and at most 2 log U elements in X-fast trie. X-fast trie stores O(n / log U) representatives. You can see where Y is because of comparison.

2017年7月24日月曜日

Van Emde Boas Trees

Our universe is full of natural numbers.

U={0,1,2,・・・U-1}

There are O(1) machine words in U.

S is the element of U.

・insert(x) is adding x to S.
・empty() is S=φ.
・lookup(x) is x∊S.
・delete(x) is removing x from S.
・max() and min() are the maximum or minimum element of S.

A bitvector is an array of bits of length U.

・insert(x) is setting the bit for x to 1.
・delete(x) is setting the bit for x to 0.
・lookup(x) is checking whether the bit for x is 1.

Space usage is Θ (U).
110011000111111000

This is quite slow. O(1) is faster than O(logU).

000010000 This is O(1) which is easy to find.

Break the universe (U) into Θ( U / B) blocks of size B. It is Tiered Bitvectors.


Data structure that supports each of the following operations in O(log log U) time, where all keys belong to the range {0, 1, ..., U-1}.
U=2^m (m is natural numbers)



There are O(log2 16)=4 operations, and min and max are √4=log2 4.



Internal nodes can be seen as an an array summary[0 .. √U–1].

T(m)=T(m/2)+O(1)


You see hash tables O(n), (0,1,2,3,4・・・・). O(1) is fast to reach your purpose.


2017年7月7日金曜日

Legendre transformation

Optimization is hard to understand.

H=H(q,p;t)=T+V


Hamiltonian represents the total energy of the system, which is the sum of kinetic (T) and potential energy (V). q is generalized coordinates, p is generalized momenta, and t is time.

The Hamiltonian is calculated using the usual definition of H as the Legendre transformation of L.


・ is differentiation.


The momenta are calculated by differentiating the Lagrangian with respect to the generalized velocities.


H=0. It is numerical vectors.



One might think this means that imaginary numbers are just a mathematical game having nothing to do with the real world. From the viewpoint of positivist philosophy, however, one cannot determine what is real. All one can do is find which mathematical models describe the universe we live in. It turns out that a mathematical model involving imaginary time predicts not only effects we have already observed but also effects we have not been able to measure yet nevertheless believe in for other reasons. So what is real and what is imaginary? Is the distinction just in our minds?
— Stephen Hawking


This is the Legendre transformation of L.



You see the bottom (A). y=0.