Saturday, May 28, 2005

Energy game

Suppose teams have "energy points" to allocate to games through the season. When two teams play each other in a game, the team which had allocated more energy points will win. The teams all play against each other, in some variation of round robin. The goal is to finish the season with the best record.

Lots of variations: whether all games are played simultaneously, whether teams all begin with the same number of energy points, the outcome of each game is probabilistic on the difference or ratio of energy points, imperfect information of how many energy points the opposing team has, or started off with, or used in previous games. With unequal initial energies, the goal might be to finish with a better record than teams with greater initial energies.

Voice bookmarks

Let web bookmarks be accessed a recorded voice tag, much like voice activated dialing on cell phones.

--

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

Thursday, May 26, 2005

Game of Y

Does the game of Y necessarily have to have a winner?

--

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

Friday, May 20, 2005

Translation from latin-1 to ASCII

Latin-1 (ISO 8859-1):
tr![\xc0-\xff]![AAAAAAECEEEEIIIIDNOOOOO*OUUUUYTsaaaaaaeceeeeiiiidnooooo/ouuuuyty]!;
Getting rid of those accents.

Tuesday, May 17, 2005

Modern cattle

What is a modern version of Archimedes's cattle problem? A problem which will require 2,000 years to solve.

Part I of the cattle problem was a set of linear Diophantine equations; Part II added quadratic Pell-equation constraints. A modern extension might add cubic elliptic-curve constraints.

Alternatively, factoring F12 will probably take on the order of 2000 years.

update: "An unusual cubic representation problem" by Andrew Bremner and Allan MacLeod.

Certicom ECC order factorizations

just some unformatted notes of the harder ones.

862591559561497151050143615844796922676745216137584527768676481602284639 solution 3 [2, 1; 241, 1; 13633, 1; 5550215053208003929302852601201, 1; 23651403663025001450257295998140623, 1]

15450938044564692288746582873614059390629490453344209663962540632677447295745316740045672843724365195742523 solution 4 [2, 1; 41, 1; 24639539179251210855889, 1; 227011624723863689126629, 1; 4549697311286994681589117379, 1; 7404194459971394608150930435979, 1]

? m[5] %5 = 587135645693458306972370149197334256843920637227079966811081824609485917244124494882365172478748165648998663

[2, 1; 17, 1; 239, 1; 359, 1; 9137, 1; 52195183, 1; 3544939683290142715349, 1; 119048596986995103937710155160761091324964506194606913025949983644817, 1]

? m[6] %5 = 815061317237192195822186322581994619328922585201839922566836546496458006742605076478278502538607299555033837 [2, 2; 3, 2; 22640592145477560995060731182833183870247849588939997849078792958234944631739029902174402848294647209862051, 1] [2, 1; 5, 2; 289729071978852212063521, 1; 1562880244694956534724744409145689309637193746299406076190301328929803286807967321, 1] [2, 3; 5, 1; 7, 2; 11, 1; 19, 1; 109, 1; 35002321230253561971279870916994230549204397557833418203638668836315513707, 1] [2, 1; 54934487254227589231, 1; 6079857359179201369147, 1; 52399649852849583985441933671329, 1]

Elliptic Curves with Pari/GP

From the example in section 3.1.2 in the Certicon ECC Challenge.

? t=Mod(1,2)
%1 = Mod(1, 2)
? p1=t*x^4+t*x+t
%2 = Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)
? polisirreducible(p1)
%124 = 1
? a=Mod(t*x+t,p1)
%3 = Mod(Mod(1, 2)*x + Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2))
? tt=Mod(t,p1)
%4 = Mod(Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2))
? e=ellinit([tt,a,0,0,tt])
%5 = [Mod(Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), Mod(Mod(1, 2)*x+ Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), 0, 0, Mod(Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), Mod(Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), Mod(Mod(0, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), Mod(Mod(0, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), Mod(Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), Mod(Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), Mod(Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), Mod(Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), Mod(Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), 0, 0, 0, 0, 0, 0]
? a1=[Mod(t*x^3+t*x^2,p1),Mod(t*x^2+t,p1)]
%6 = [Mod(Mod(1, 2)*x^3 + Mod(1, 2)*x^2, Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2)), Mod(Mod(1, 2)*x^2 + Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2))]
? ellisoncurve(e,a1)
%7 = 1
? elladd(e,a1,a1)
%8 = [Mod(Mod(1, 2)*x^2 + Mod(1, 2)*x + Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x+ Mod(1, 2)), Mod(Mod(1, 2)*x^2 + Mod(1, 2), Mod(1, 2)*x^4 + Mod(1, 2)*x + Mod(1, 2))]
? q=[0,tt];
? for(pw=1,3,q1=q;
? for(i=1,length(q1),q1[i]=q1[i]+Mod(t*x^pw,p1));q=concat(q,q1))
for(ea=1,length(q), for(ec=2,length(q), e=ellinit([tt,q[ea],0,0,q[ec]]);listkill(l);for(i=1,length(q), for(j=1,length(q), if(ellisoncurve(e,[q[i],q[j]]),listput(l,[q[i],q[j]]))));print(ea-1," ",ec-1," ",length(l)+1)))

? for(s=1,length(l), for(i=1,length(l)+1, if([0]==ellpow(e,l[s],i),print(s," ",i);break)))

It's unfortunate the output is so messy.

Thursday, May 12, 2005

Tuesday, May 10, 2005

Decoding certificates

$ wget http://bs.mit.edu/mitca.ca
--00:02:56-- http://bs.mit.edu/mitca.ca
=> `mitca.ca'
Resolving bs.mit.edu... 18.7.21.84
Connecting to bs.mit.edu[18.7.21.84]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 617 [application/x-x509-ca-cert]

100%[====================================>] 617 --.--K/s

00:02:56 (5.88 MB/s) - `mitca.ca' saved [617/617]

$ openssl x509 -inform DER -text -in mitca.ca -noout
Certificate:
Data:
Version: 1 (0x0)
Serial Number: 0 (0x0)
Signature Algorithm: md5WithRSAEncryption
Issuer: C=US, ST=Massachusetts, O=Massachusetts Institute of Technology, OU=MIT Certification Authority
Validity
Not Before: Jul 15 20:23:00 1996 GMT
Not After : Jul 13 20:23:00 2006 GMT
Subject: C=US, ST=Massachusetts, O=Massachusetts Institute of Technology, OU=MIT Certification Authority
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (1024 bit)
Modulus (1024 bit):
00:d3:d0:eb:e7:51:b5:33:75:a6:d8:a3:84:ea:02:
70:5c:cf:9c:20:e0:0b:03:8b:8e:46:6e:15:25:e1:
77:f6:6b:c4:70:dd:d4:16:0b:cc:11:88:31:38:0b:
ee:7c:59:24:57:e9:8d:cd:75:f8:52:63:dd:33:0c:
f0:4f:9f:b5:fc:91:ae:32:85:8c:1a:75:63:19:98:
86:1e:92:23:b2:87:f3:f5:c9:a6:a2:97:68:f2:ec:
b2:1a:ad:b3:f5:ed:09:ea:cc:e7:bc:b4:64:50:15:
e6:57:00:1a:7a:c6:de:fe:e1:30:58:5a:5d:ab:bb:
b4:1c:11:ec:64:c1:d3:a4:55
Exponent: 65537 (0x10001)
Signature Algorithm: md5WithRSAEncryption
01:19:13:24:13:13:28:10:db:54:0d:00:24:18:ca:02:35:27:
af:bb:39:03:c5:e2:76:b9:7b:49:f9:1d:91:cb:52:fd:b6:09:
52:c4:ed:73:93:37:37:e2:cc:6f:18:a8:3f:47:9e:16:c6:60:
31:81:3a:21:7f:f8:27:05:2a:88:e6:51:0d:ae:24:32:b9:c5:
6a:04:02:be:4f:60:95:d2:82:92:6a:ec:65:0c:54:39:5b:54:
74:52:a2:85:6c:80:be:4d:29:f3:75:be:e0:d5:80:70:6b:dc:
39:5a:13:68:c6:ec:0e:87:b7:31:26:26:56:2d:86:bb:4c:80:
7b:43
$ bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
ibase=16
00D3D0EBE751B53375A6D8A384EA02\
705CCF9C20E00B038B8E466E1525E1\
77F66BC470DDD4160BCC118831380B\
EE7C592457E98DCD75F85263DD330C\
F04F9FB5FC91AE32858C1A75631998\
861E9223B287F3F5C9A6A29768F2EC\
B21AADB3F5ED09EACCE7BCB4645015\
E657001A7AC6DEFEE130585A5DABBB\
B41C11EC64C1D3A455

14874232348041148870879819006215632592626006624089886671166071398570\
02103995689503190533069669831630135040326377461588598729653631965144\
40766020608225910888987591998289529837389575629713521989417386401506\
78089276107148587284179435836431649958136516334321733549452470076311\
2519694607834206454009153643273757781
quit
$ t=14874232348041148870879819006215632592626006624089886671166071398570\
02103995689503190533069669831630135040326377461588598729653631965144\
40766020608225910888987591998289529837389575629713521989417386401506\
78089276107148587284179435836431649958136516334321733549452470076311\
2519694607834206454009153643273757781

> > > > $ $
$ /afs/sipb.mit.edu/project/pari-gp/arch/i386_rh9/bin/gp
GP/PARI CALCULATOR Version 2.1.5 (released)
i686 running linux (ix86 kernel) 32-bit version
(readline v4.2 enabled, extended help available)

Copyright (C) 2002 The PARI Group

PARI/GP is free software, covered by the GNU General Public License, and
comes WITHOUT ANY WARRANTY WHATSOEVER.

Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.

realprecision = 28 significant digits
seriesprecision = 16 significant terms
format = g0.28

parisize = 4000000, primelimit = 500000
? \g5
debug = 5
? factorint(148742323480411488708798190062156325926260066240898866711660713985700210399568950319053306966983163013504032637746158859872965363196514440766020608225910888987591998289529837389575629713521989417386401506780892761071485872841794358364316499581365163343217335494524700763112519694607834206454009153643273757781)
Miller-Rabin: testing base 1000288896
IFAC: cracking composite
148742323480411488708798190062156325926260066240898866711660713985700210399568950319053306966983163013504032637746158859872965363196514440766020608225910888987591998289529837389575629713521989417386401506780892761071485872841794358364316499581365163343217335494524700763112519694607834206454009153643273757781
IFAC: checking for pure square
OddPwrs: is 148742323480411488708798190062156325926260066240898866711660713985700210399568950319053306966983163013504032637746158859872965363196514440766020608225910888987591998289529837389575629713521989417386401506780892761071485872841794358364316499581365163343217335494524700763112519694607834206454009153643273757781
...a 3rd, 5th, or 7th power?
modulo: resid. (remaining possibilities)
211: 86 (3rd 1, 5th 0, 7th 0)
209: 6 (3rd 0, 5th 0, 7th 0)
IFAC: trying Pollard-Brent rho method first
Rho: searching small factor of 1024-bit integer
Rho: using X^2+1 for up to 49152 rounds of 32 iterations
Rho: time = 73790 ms, 24576 rounds
Rho: fast forward phase (8192 rounds of 64)...
Rho: time = 34590 ms, 32772 rounds, back to normal mode
Rho: time = 19330 ms, 40960 rounds
Rho: time = 19490 ms, Pollard-Brent giving up.
IFAC: trying Shanks' SQUFOF, will fail silently if input
is too large for it.
IFAC: trying Lenstra-Montgomery ECM
ECM: working on 64 curves at a time; initializing for up to 400 rounds...
ECM: time = 0 ms
ECM: dsn = 12, B1 = 1800, B2 = 198000, gss = 128*420
ECM: time = 73080 ms, B1 phase done, p = 1801, setting up for B2
ECM: time = 1300 ms, entering B2 phase, p = 2017
ECM: time = 45340 ms
ECM: dsn = 14, B1 = 2200, B2 = 242000, gss = 128*420

Some factorization problems (and solutions)

Long strings of zeros and nines compress well.

g= [10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 23, 25, 27, 29, 32, 34, 37, 40, 43, 46, 50, 54, 58, 63, 68, 74, 79, 86, 93 ] ; for(i=1, 307, for(j=1, 30, s=(g[j]*10^i); a=precprime(s); b=nextprime(2*s); c=a*b; lc=log(c); print(ceil(lc/log(2)), " ", ceil(lc/log(10)), " ", c, " ", g[j], "*10^", i, a-s)))

Friday, May 06, 2005

ECC DOF

Elliptic Curve Cryptography, on the field GF(2^m), appears to have 4 degrees of freedom: The reduction polynomial of the field, the fixed point P, and the curve parameters a and b.

exp exp exp exp 1

I calculated the 1,656,521-digit number e^e^e^e = exp(exp(exp(exp(1)))). The digits surrounding the decimal point are: ... 4,745,087,021.2212029997 ...

The entire number is e^e^e^e here.

Thursday, May 05, 2005

Large-print LaTeX

In Acrobat Reader, open this document in View | Continuous - Facing, and Maximize the window size. You should be able to read the text comfortably. This is the One True Solution to the "monitors are landscape but paper is portrait; people like to read narrow columns not wide screens" problem.

\usepackage{type1cm} \setlength{\topmargin}{-0.5in} \setlength{\oddsidemargin}{-0.5in} \setlength{\evensidemargin}{-0.5in} \setlength{\textwidth}{7.5in} \setlength{\textheight}{9in} \setlength{\footskip}{0in} \makeatletter \renewcommand\Huge{\@setfontsize\Huge{49.76}{60}} \renewcommand\LARGE{\@setfontsize\LARGE{34.56}{44}} \renewcommand\Large{\@setfontsize\Large{28.8}{36}} \renewcommand\footnotesize{\@setfontsize\footnotesize{16}{19}} \renewcommand\huge{\@setfontsize\huge{41.48}{50}} \renewcommand\large{\@setfontsize\large{24}{28}} \renewcommand\normalsize{\@setfontsize\normalsize{20}{24}} \renewcommand\scriptsize{\@setfontsize\scriptsize{14}{16}} \renewcommand\small{\@setfontsize\small{18}{22}} \renewcommand\tiny{\@setfontsize\tiny{10}{12}} \makeatother

Tuesday, May 03, 2005

flight delays

New York and Newark airports are having delays because other airports are not having delays. Too much volume.

--

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