Friday, September 30, 2005

Geiger random bits

Given a stream of random integers with unknown distribution (representing time spacing between clicks of a Geiger counter), how would one generate a stream of random bits from it?

A simple method is to compress the stream, then hash chunks of sufficiently large compressed output. It requires some prayer that the compression picked up the distribution peculiarities, and that the hash function is good enough.

An even simpler method is just to substitute, or pre-augment, compression with the least significant bit of each integer.

Urchin

When posting, blogger will quietly make a connection to Urchin, a web monitoring company and Google acquisition.. Perhaps for "Republish entire blog" only.

Firefox Fitt's law correct

Kudos to firefox for following Fitts law of UI design correctly, at least under Windows.

First, maximize the firefox window. Go to the left hand edge of the screen by the back button. Notice you can activate "Back" even with the mouse cursor pressed up against the edge of the screen. Similarly, you can hit the tab-close "X" button againt the right edge of the screen. Also the "File" menu header and the firefox homepage shortcut (but not the File menu contents).

IExplore, on the other hand, does everything wrong. The back button, the file menu are all surrounded by 1 pixel edges that are inactive.

The WinXP UI, especially the start menu button, taskbar, position of the window close "X", expanded title bar and window manipulation buttons, expanded window-resize gripper in the lower right hand corner are all well designed. However, the contents of the start menu itslf (left column) do not lie against the left edge of the screen.

It's interesting that there is (correctly) no separation between the close and maximize buttons, but there is a two pixel gap between the active regions of the minimize and maximize buttons.

Baseball probabilities of playoffs

In the spirit of the baseball RIOT project, is it possible to work out the probability that a given team, at a given point in the season, will make the playoffs, assuming (very incorrectly!) that the outcome of every remaining game will be determined by a 50-50 coin flip? Report the log of that probability for a more sane number.

Wednesday, September 28, 2005

My documents cygwin permission

why does "My Documents" not have user write permissions (i.e., -w), i.e., dr-x------ by default in Cygwin?

Thursday, September 22, 2005

System Restore is Hard

In watching the thinkpad "system restore to factory pre-installed state" process at work (a long complicated script involving multiple reboots), I can understand why IBM no longer wants to be in this business and has sold it off to Lenovo.

I predict Lenovo's thinkpad (especially this restore process) quality will go down in the future as Lenovo doesn't have the resources to keep engineering this.

Tuesday, September 20, 2005

Monday, September 19, 2005

Hash permutation

To make it difficult to generate new collisions from old, specify a pre-permutation, such as Burrows-Wheeler or modular expn.

--

Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Wednesday, September 14, 2005

Square phone numbers

10-digit numbers that are also perfect squares, cubes, etc. (prime powers). For example, there are only 5 phone numbers that are perfect 7th powers of integers:

249-435-7888

340-482-5447

458-647-1424

610-351-5625

803-181-0176 (Are prefixes allowed to start with 1? This one might be eliminated.)

Collatz on a random Huge Integer

I've been running the 3N+1 sequence on a randomly chosen 200,000-bit integer, in hopes that non-4-2-1-terminating numbers become far more frequent at higher values. It's now been running 5.8 days and still hasn't terminated. My implementation is very slow, so I don't know what this means, yet. I unfortunately don't print out iteration numbers as I go, nor do I checkpoint. It is supposed to stop if it iterates 100 times longer than the number of bits it started out with.

It hasn't run out of memory, so the values aren't growing vastly unbounded in size.

Tuesday, September 13, 2005

Circle T

How would one inscribe the letter T in a circle to divide the circle into 3 equal pieces? Other letters?

--

Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Monday, September 12, 2005

Kerning Alphabet

Each quadrant can be straight or slant left or right, for a total of 81 letter shapes.

--

Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Celsius Fahrenheit

Motivated by the gnome panel app giving temperature in Celsius:

CF
40104
3595
3086
2577
2068
1559
1050
541
032
-523
-1014
-155
-20-4

Each 5-degree interval has a certain feel. Also one of the weird times it's intuitive to have the numbers in descending order.

Sunday, September 11, 2005

factorint nextprime

The penultimate factor of p-1 of the next prime after the given power of two. See also factorint precprime

gettime();for(i=3,1000,x=factorint(nextprime(2^i)-1);y=matsize(x);if(y[1]>1,print(i," ",x[y[1]-1,1]," ",gettime())))

3 => 2 , 5 => 2 , 6 => 3 , 7 => 5 , 9 => 5 , 10 => 5 , 11 => 3 , 12 => 3 , 13 => 3 , 14 => 5 , 15 => 29 , 17 => 19 , 18 => 3 , 19 => 41 , 20 => 101 , 21 => 3 , 22 => 3 , 23 => 17 , 24 => 103 , 25 => 11 , 26 => 3 , 27 => 3 , 28 => 19 , 29 => 23 , 30 => 59 , 31 => 149 , 32 => 131 , 33 => 59 , 34 => 1277 , 35 => 7 , 36 => 883 , 37 => 953 , 38 => 35573 , 39 => 383 , 40 => 5 , 41 => 277 , 42 => 227 , 43 => 227 , 44 => 97 , 45 => 120739 , 46 => 1947973 , 47 => 331 , 48 => 1361 , 49 => 7 , 50 => 11 , 51 => 3517 , 52 => 612229 , 53 => 6529 , 54 => 7724869 , 55 => 246241 , 56 => 34501 , 57 => 246241 , 58 => 33829 , 59 => 1361 , 60 => 2971 , 61 => 2447 , 62 => 15467 , 63 => 7005787 , 64 => 7 , 65 => 1499567 , 66 => 5419 , 67 => 312709 , 68 => 5419 , 69 => 293 , 70 => 2 , 71 => 4787 , 72 => 60594931 , 73 => 60594931 , 74 => 1559689 , 75 => 7416361 , 76 => 971 , 77 => 10362841 , 78 => 389 , 79 => 3677 , 80 => 31039 , 81 => 78233 , 82 => 3 , 83 => 52825813 , 84 => 155377 , 85 => 14009 , 86 => 2846950409 , 87 => 126265247 , 88 => 676348286641 , 89 => 13614755069 , 90 => 1892113 , 91 => 35320663991 , 92 => 296131229 , 93 => 3491 , 94 => 3033169 , 95 => 17 , 96 => 619 , 97 => 4153421 , 98 => 9917839 , 99 => 1474408489 , 100 => 52203989 , 101 => 956903 , 102 => 15183787 , 103 => 23561 , 104 => 3544157 , 105 => 733 , 106 => 17 , 107 => 29207603 , 108 => 415141630193 , 109 => 3019 , 110 => 5 , 111 => 3121 , 112 => 28976429 , 113 => 379 , 114 => 1490834899 , 115 => 27726931 , 116 => 25781083 , 117 => 190570805678557 , 118 => 28343271991 , 119 => 59393 , 120 => 322747 , 121 => 28124221 , 122 => 7471602694511 , 123 => 2 , 124 => 187385987 , 125 => 379 , 126 => 198685121119 , 127 => 54721235939 , 128 => 5816689 , 129 => 229668251 , 130 => 66361823149 , 131 => 419 , 132 => 33773 , 133 => 11197 , 134 => 1132854612138368291 , 135 => 34110701 , 136 => 94841 , 137 => 1069 , 138 => 1883157135247 , 139 => 32081978728531 , 140 => 577 , 141 => 4506937 , 142 => 14155556315601773 , 143 => 111349165273 , 144 => 7 , 145 => 29 , 146 => 404011 , 147 => 35354098335041 , 148 => 84900373 , 149 => 29 , 150 => 66611352953 , 151 => 853 , 152 => 4078967803638757 , 153 => 28190690609748977 , 154 => 57638029 , 155 => 3183398673950160499 , 156 => 254572484479 , 157 => 140135408598613 , 158 => 600696432006490087537 , 159 => 39591902879 , 160 => 173848897619 , 161 => 2092970810101 , 162 => 738622015238517469867 , 163 => 72680077859 , 164 => 371631372010427 , 165 => 3033872055694266793 , 166 => 51581 , 167 => 19 , 168 => 213856863324036931 , 169 => 7673 , 170 => 349682762843012539 , 171 => 8562191377 , 172 => 996637 , 173 => 1184811007753 , 174 => 519812308091528579 , 175 => 64082150767423457 , 176 => 3541 , 177 => 2262418866139 , 178 => 203889220265798047 , 179 => 191177683417957 , 180 => 2620759002413 , 181 => 238166046827263 , 182 => 116646869443567827421 , 183 => 15459263 , 184 => 402091141946990581 , 185 => 422130953307364455748703 , 186 => 730933508801191 , 187 => 457507 , 188 => 42407 , 189 => 228226151 , 190 => 768614336404564651 , 191 => 127391413339 , 192 => 249964755824311260181 , 193 => 43691 , 194 => 14582476464855624168947 , 195 => 530973811979278664611 , 196 => 12983 , 197 => 78739038977031613 , 198 => 341117591230040819 , 199 => 27806552462203 , 200 => 62620177 , 201 => 135096265434489839 , 202 => 675889 , 203 => 22804045411650469 , 204 => 52626249439 , 205 => 575944527944101109 , 206 => 6713103182899 , 207 => 638624977 , 208 => 8572547189567 , 209 => 1248251259919 , 210 => 8831418697 , 211 => 5699217237190662496813 , 212 => 32322044425553 , 213 => 3185257 , 214 => 48831491 , 215 => 598101348759401 , 216 => 3 , 217 => 146919792181 , 218 => 329824456676414692409 , 219 => 84229 , 220 => 457 , 221 => 10269694647880783 , 222 => 562749712093113293639265552817 , 223 => 3354409408717 , 224 => 9907 , 225 => 7 , 226 => 21337199679782081 , 227 => 964143547970507 , 228 => 3454631579714210387 , 229 => 84379598431955155155523 , 230 => 891695404608302473 , 231 => 3313389311 , 232 => 58879676392546531901 , 233 => 7 , 234 => 30766081371962430877027 , 235 => 2740834682972131 , 236 => 22735307249651 , 237 => 2687861391381743 , 238 => 3651704087219939111 , 239 => 618399785157681981868109 , 240 => 6999441151774987463 , 241 => 8379052851628702138261 , 242 => 414745175048619315247 , 243 => 120562177 , 244 => 213973 , 245 => 307817541673849 , 246 => 2361846005176909259 , 247 => 64731702760358791 , 248 => 89494061 , 249 => 7 , 250 => 548379867989362859525425493551 , 251 => 15162868758218274451 , 252 => 1793551536392300393836110149 , 253 => 3271389001471 , 254 => 2 , 255 => 36139168099759229 , 256 => 1200461269659761894123 , 257 => 5977729210235941 , 258 => 92688479535572441677859 , 259 => 11927816443 , 260 => 151995302154206813139306866773 , 261 => 24187325339

Largest factor

Some code to extract the largest factor of an integer, in Pari/GP

x=factor(v);y=matsize(x);x[y[1],1]

Party over radio

Small FM radios can be purchased for as little as two dollars (for example, search for FM radio at froogle and sort by increasing price). Imagine a dance party where everyone is given a headset to wear, and a local FM transmitter (either in the room or perhaps a FM station), and the dance party takes place essentially in silence with everyone listening to the same station.

Part of the motivation for this is to get around noise laws and how late parties are allowed to go.

Smooth plus delta

Represent a number by a smooth factorization plus (or minus?) a delta less than the largest factor.

Saturday, September 10, 2005

Sawfish alt-tab

Sawfish behaves alt-right-tab and alt-left-tab behave slightly differently; alt-right-tab leaves the window name floating in the center of the screen, alt-left-tab does not.

Random Word generator

Dai uzen ehoo lotreersipeenk lo i ahupepy ignurde zaj cunai ashi grimp ye i obre hungo hai cistelf a o rikefroo islemoclo sla ursen end kitroong a tho dijuji. A ers utunpob bling ormolt zu ocalp crajulti nengicroc wel tronsu toor obecradait plo ep ni plulaistutang tac ert stoonkimi a uhalpo itwomuc zujyplospink i azocterdeeg.

Friday, September 09, 2005

contineu a not word

"contineu" is in the linux /usr/share/dict/words as a correctly-spelled word.

Failure Java gcc-4.0.1 compile

w3c.jar:1: error: Class or interface declaration expected. PK^E^F

1 error make[4]: *** [libw3c_gcj_la-w3c.lo] Error 1

(Giving up by disabling gcj compililation, for now.)

Thursday, September 08, 2005

170 factorial

170! is the highest factorial you can calculate using standard double-precision floating point.

Tuesday, September 06, 2005

Userland AFS

If one had a microkernel operating system, and the filesystem "modules" ran in userland instead of kernel space, one in principle wouldn't even have to be root to have AFS; in stark contrast to having to go so far as to recompile the kernel to get AFS for some versions of Linux. Such is the appeal of non-monolithic kernels.

Monday, September 05, 2005

Language of matched parentheses

Given bitwise data, how can one encode it in the language of matched parentheses (possibly different types of parentheses). We seek a mapping function from bits to tree structures.

failure

If you enter failure into Google and hit the jISuDrup (or equivalent if your language preference isn't Klingon), you get Biography of President George W. Bush. I have no problems in propagating the meme.

blogger cleaned up SEO

When following the "Next Blog" buttons at the top, one no longer get tons of Search Engine Optimization pages.

printing into notebook

Printing directly into a notebook could be solved by a handheld scanner (not flatbed) like device. The key idea is the laser computer-vision-powered location technology that powers modern optical mice. Use the camera to determine where you are on the page and determine whether to drop ink, tonor, high-powered laser to burn the page, at that location. The printer need not be as wide as the page; once can go up and down "painting" strips of the page one wants to print. Come to think of it, handheld scanners can be improved by the laser location idea as well.

Sunday, September 04, 2005

Embedded DOC pdf

When Microsoft Word exports to PDF, it would be nice if the original .doc file were embedded in the comments of the PDF so that the PDF is effectively editable by extracting the original. Similarly, I suppose, with LaTeX, DVI, and OpenOffice.

Friday, September 02, 2005

GF(13) digit permutation

case d in (0..4): p=d+1; d in (5..9): p=d+2; v=Mod(e,13)^p return v-2 where e in {2,6,7,11}; //e==2 maps 3 to 3