analytics

Sunday, May 10, 2015

Artificial writing system

I was wondering if it were possible to make a single simple character for every word in the English language, which is around 100,000 words not counting really esoteric ones... Similar idea to Chinese but easier to write and with simpler basic elements...
Consider the following chart:


Each numbered line or curve is a stroke divided into six basic categories, when writing a character one would learn to always write strokes from a lower number category first and subsequently write the strokes in that category in the character in their order by number as seen above...
For example, one would write character 1 below as follows, the vertical line first, because that's category 1, then the diagonal line because that's the next lowest category, 3, then both the halves of the circle are written left half first because both are category 6, but the left half is a lower number, 1,  within that category, then the right half is number 4 within that category so goes last...
Character 2 would start with the horizontal line because that's category 2, then the two diagonal rightmost first, then the bottom c shape.

So the fact that every character can be written by stroke order also makes it possible to alphabetize all the possible characters like so, all characters that start with category one strokes go first, then within that group characters who have a first stroke with a lower number go before those with a higher number, and a tie is broken by comparing second strokes and so on to the last stroke, with the rule that for characters sharing exactly the same strokes but one has more strokes total, the shorter goes first...
The fact that they can be alphabetized makes it possible to make a dictionary for the words...

So the number of possible characters is hard to say exactly because you generally don't want any character with disconnected parts and it can get hard to say when that might be, choosing 2, 3, 4, or 5 strokes from 26 possible strokes is somewhere north of 90,000 characters so 99.99% of the words that people use could be written simple with one character... Next I might write a computer program that generates a sample sheet of text written in this language I think it will look pretty interesting...

**Division of meanings**

I was thinking that the way the word is written could show the part of speech, for example starting with a stroke from category 1 could be a noun, which most words are in the English language, category 2 could make the word an adjective, category 3 verb, and category 4 adverb, Anything composed solely from strokes in category 5 and 6 and 7 would be prepositions, pronouns, and other minor parts of speech, of which there are around 1000 in the English language which matches up with the number of ways to create a symbol from the 3 categories. 
And then even beyond parts of speech words could be categorized by how they are written, like the last word above is a noun because it has horizontal lines but the next stroke is category 5 which could, theoretically, indicate the noun is a place of some kind... Maybe further divisions are even possible like the third stroke might indicate a noun is a type of animal...

**Pronunciation

It might be possible to map every word in English to one syllable sounds, since so many aren't used like scrug and footh, one count estimates there are about 100,000 possible, the trick would be to map the possibilities into the writing system...

Friday, May 8, 2015

Component algebra and simple connected graphs

I wanted to go more in depth on the previous idea on the blog but I have to coin some terms to be able to write about it as I don't know what it would normally be called if it's already something that's studied. So I call it component algebra...
   Each component is a variable a,b,c,... and it is related to other components through multiplication... Each somponent is equal to the multiplication of one or more of the other components, with a couple more rules that I'll show below...
So there might be a list of these component relationships like below, and a corresponding simple and connected graph, which is drawn so that components are equal to the multiplication of components that they are connected to...



And we are also interested in the solutions which can be found by variable elimination, for example plugging what one component is equal to in each of the rest of the equations and proceeding until there is only one variable in one equation, and backsolving. It is easy to see there must be always at least two solutions, every component equals 1 or every component equals 0, but in the case above there are even more...
In the above e=e is Maple's way of saying that e can be any value, so in this case there are infinitely many solutions.  So if e =2, say, the non-zero solution would be a=1/4, b=2, c=1/4, d=1/4, e=2, f=4, those we can say "satisfy" the graph... See that for instance c=1/4 = a*b*d*e = (1/4)*2*(1/4)*2=(1/4). And all the other components work as well. 
The fact that the equations are related to a simple and connected graph ensures that every variable is defined, all exponents are 1, and a variable can occur on the left or right side of an equation but not both at the same time... a.k.a there are no loops in the graph. These all make the system relatively easy to solve. 

The interesting thing to study is when there are more than the two trivial solutions, but I'm working on how to know when that will be... Sometimes the solutions are complex numbers as well...

**As sums**

Dr. Rose suggested perhaps using sums as linear equations might be simpler, for example...
Sometimes that is easier and nicer to think about but other times it misses solutions at least in Maple:

In the example above using linear sums only shows a trivial solution but the product shows more solutions...


Wednesday, May 6, 2015

Algebraically coloring a map

I noticed you can take an uncolored map like:

You can set up a set of equations to solve for, as follows... if region X is next to regions Y, Z,... one equation is X=Y*Z*...
For the above:
Note that C is not considered adjacent to D...

And there are a few solutions to the above, but we can add extra conditions such as A!=B, because A and B are adjacent and so on until we get down to one solution...
Now we can use a map of these complex numbers to color values by putting a color wheel on the complex plane:
And use that as a key to fill in the colors:
In this case it gave 5 colors not 4 as for the famous 4 color theorem, but I still think it's an interesting process...

Sunday, May 3, 2015

Point in Convex polygon using cross products

Suppose you have a convex polygon like below labeling vertices clockwise from A, and we want to know whether some point Z is inside or outside the polygon...
Clearly if vector v from point B to point Z makes an angle greater than 180 degrees with vector u from point A to point B, the point is outside of the polygon, as the polygon is convex, and that would make the polygon concave if Z was inside of the polygon and the angle was greater than 180 degrees...
This is equivalent to saying if cross product uxv is positive point Z is definitely outside the polygon! A simple calculation...

Now consider u(2) to be vector BC and v(2) to be vector CZ, the same reasoning holds and we see that if u(2)xv(2) is positive the point Z must be outside the polygon,  in fact going all the way around if any such cross product is positive, the point Z must be outside the polygon...

So it's necessary that none of those cross products are positive, as it turns out it is evidently also sufficient, as determined by drawing many such polygons in a program like Geogebra and dragging the vector around and noting the angles when the point is inside and when it is outside but I haven't thought of a good proof.

Monday, April 27, 2015

Distributed bubble sorting

I was trying to think of a way to split a sorting task over many processors like for instance on a gpu, my rough idea is this...
First the many items in unsorted order are given out to the many processors an equal number to each processor... Each processor ...p,q,r... finds the lowest and highest item of those given to it L(x) and H(x) and once they've all completed that. every processor exchanges it's lowest item with the processor to the left if it is smaller than that processors largest item,  and it's highest item with the processor to the right if it is greater than that processors smallest item (or keeps it if it's the first or last processor)... This process is repeated until no more items can be exchanged. By then every item in a processors list of items should be greater than every item in the processor to it's left and less than every item in the processor to it's rights list of items, then this can either be recursed upon or each processor can sort it's items and append them all to one master list...

A lot of whether it's feasible depends on architectural questions that I'll have to learn about as I learn how to program a gpu but I'm just making a note of this idea...

Thursday, March 5, 2015

Telling whether a point is in a simple polygon in O(n) time

This algorithm combines two other algorithms that have been developed to make a very fast way to tell whether a point is inside a simple polygon, even one with holes!

First you have your polygon:
There's been developed an algorithm to triangulate this region in Linear time, here... http://link.springer.com/article/10.1007%2FBF02574703

There are several ways this can be done, I'm not sure exactly which it would come up for for this polygon...
Now one simply checks whether the point in question is in any triangle of the triangulation which can be done like here in constant time:
http://www.blackpawn.com/texts/pointinpoly/

So overall the algorithm is n-2 constant time steps for checking whether the point is inside any of the triangles and linear time for the algorithm, which gives O(n) time.

I'm not completely familiar with the triangulation algorithm, but maybe there could even be optimizations for starting the triangulation somewhere near the point in question and of course you can stop once you've found a triangle it's inside of...

Monday, March 2, 2015

Area by continuously scaling generalized radius

Suppose you have a square...
Imagine you start with a square of a sort of generalized idea of radius R, the perimeter will be 8*r, and shrink it until it has radius 0, the integral over that transformation is the Area of 4*r^2 or the length of a side squared...
For a circle you do the same thing but use the circumference...


And above for an octagon, though finding P(r) is more difficult...