Method of Least Squares
Kepler's Third Law, Zipf's Law (word frequencies)

periodT = {0.2408467,0.61519726,1.0000174,1.8808476,11.862615,29.447498,84.016846, 164.79132};
semimajoraxisL = {0.387, 0.723, 1.000, 1.524, 5.203,9.539,19.182, 30.06}

LogT = Log[periodT]
LogL = Log[semimajoraxisL]

x = LogL; y = LogT;
xbar = Sum[x[[i]], {i,1,8}] / 8;
sigmaxsq = Sum[(x[[i]] - xbar)^2,{i,1,8}]/8;
a = (8 Sum[x[[i]] y[[i]], {i,1,8}] - 8 xbar Sum[y[[i]],{i,1,8}])/(8^2 sigmaxsq)
b = (-8 xbar  Sum[x[[i]] y[[i]], {i,1,8}]  + Sum[x[[i]]^2,{i,1,8}] Sum[y[[i]],{i,1,8}])/(8^2 sigmaxsq)

(* we now use the alternate formulas for a and b *)
x2 = Sum[x[[i]]^2, {i,1,8}];
x1 = Sum[x[[i]], {i,1,8}];
x1y1 = Sum[x[[i]] y[[i]], {i,1,8}];
y1 = Sum[y[[i]], {i,1,8}];
(8 x1y1 - x1 y1) / (8 x2 - x1 x1)
(x1 x1y1 - x2 y1)/(x1 x1 - x2 8)

Clear[x]; Clear[y]; Clear[z];
v = {x,y,z};

Cross[{x,y,z}, p[1]]
Cross[{x,y,z}, p[1]] . Cross[{x,y,z}, p[1]]

D[ArcCos[t],t]

(-40+78 x,-42+78 y,-24+78 z)

(40/78)^2 + (42/78)^2 + (24/78)^2

1 + (42/40)^2 + (24/40)^2

197 5

80 5

Sqrt[80./197]

(400/985) (24/40)

48 5

Zipf's Law (word frequencies)

citypop = {8363710,3833995,2853114,2242193,1567924,1540351,1351305,1279910,1279329,948279,912062,808976,807815,798382,757688,754885,703073,687456,669651,636919,620535,613190,604477,598707,598541};
ranks = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
both = {};
For[n=1, n≤ 25, n++, both = AppendTo[both,{citypop[[n]],n}]];
ListPlot[both]
logboth = {};
For[n=1, n≤ 25, n++, logboth = AppendTo[logboth,{Log[citypop[[n]]],n}]];
ListPlot[logboth]
loglogboth = {};
For[n=1, n≤ 25, n++, loglogboth = AppendTo[loglogboth,{Log[citypop[[n]]],Log[n]}]];
ListPlot[loglogboth]

x =Log[1.0 citypop]; 
y = Log[1.0 ranks];
numdo = 5;
xbar=Sum[x[[i]],{i,1,numdo}]/numdo
sigmaxsq=Sum[(x[[i]]-xbar)^2,{i,1,numdo}]/numdo
a=(numdo Sum[x[[i]] y[[i]],{i,1,numdo}]-numdo xbar Sum[y[[i]],{i,1,numdo}])/(numdo^2 sigmaxsq)
b=(-numdo xbar Sum[x[[i]] y[[i]],{i,1,numdo}]+Sum[x[[i]]^2,{i,1,numdo}] Sum[y[[i]],{i,1,numdo}])/(numdo^2 sigmaxsq)

Log[135.]

citypop = {8085742,3819951,2869121,2009690,1479339,1388416,1266753,1214725,1208318,911402,898349,783438,773781,751682,728432,672011,645978,628670,586941,585122,584658,584113,581616,569101,563384,557478,544765,538544,523303,517017,507658,475460,471856,469032,461324,451455,445335,442768,439467,432376,423019,404267,398844,387807,380149,376815,373188,370448,355007,354617,342510,332361,332223,325337,317647,317361,316802,308973,290418,285018,281514,280404,279208,277911,271466,271035,270951,266798,248762,247610,241991,241727,239097,236620,235594,232838,229110,226401,225090,219495,218432,218027,217989,215093,214852,212215,211299,210834,206872,206481,204525,200499,200123,199336,199060,198376,198364,197488,197388,196790,196624,196093,195601,195357,194729,194455,194248,193882,193464,193316,190299,190117,187873,185702,184053,181647,180872,179894,179599,178612,176365,175706,173278,170561,167402,167082,167029,164237,162917,162742,162184,161696,160368,158880,157063,156178,154887,154147,153938,153386,152157,151903,151725,151654,151640,150867,150782,148927,147840,146878,145757,145250,144502,144413,144001,143408,142914,142621,142474,142454,142185,141336,141114,139664,137894,136671,136093,136016,133834,132197,131249,129270,128923,128549,127759,127580,127573,127005,126182,125896,125740,124977,124512,124387,124372,124192,123570,123215,122542,122008,121740,120292,120107,119708,118737,118379,117881,117357,117115,116887};
ranks = {};
For[n = 1, n≤ 200, n++, ranks = AppendTo[ranks,n]];
both = {};
For[n=1, n≤ 200, n++, both = AppendTo[both,{citypop[[n]],n}]];
ListPlot[both]
logboth = {};
For[n=1, n≤ 200, n++, logboth = AppendTo[logboth,{Log[citypop[[n]]],n}]];
ListPlot[logboth]
loglogboth = {};
For[n=1, n≤ 200, n++, loglogboth = AppendTo[loglogboth,{Log[citypop[[n]]],Log[n]}]];
ListPlot[loglogboth]

x =Log[1.0 citypop]; 
y = Log[1.0 ranks];
numdo = 200;
xbar=Sum[x[[i]],{i,1,numdo}]/numdo;
sigmaxsq=Sum[(x[[i]]-xbar)^2,{i,1,numdo}]/numdo;
a=(numdo Sum[x[[i]] y[[i]],{i,1,numdo}]-numdo xbar Sum[y[[i]],{i,1,numdo}])/(numdo^2 sigmaxsq)
b=(-numdo xbar Sum[x[[i]] y[[i]],{i,1,numdo}]+Sum[x[[i]]^2,{i,1,numdo}] Sum[y[[i]],{i,1,numdo}])/(numdo^2 sigmaxsq)

Word Frequencies

Wordfreq = {61847,29391,26817,21626,18214,16284,10875,9982,9343,9236,8875,8412,7308,6954,6810,6644,6575,6475,5096,4790,4735,4707,4626,4623,4599,4577,4452,4332,4285,4134,3801,3792,3719,3707,3578,3490,3430,3328,3227,3006,2802,2686,2608,2593,2551,2532,2493,2470,2436,2369,2354,2183,2087,2055,1962,1893,1795,1774,1733,1712,1712,1683,1649,1634,1632,1595,1561,1542,1542,1525,1524,1434,1383,1382,1364,1343,1336,1298,1277,1275,1254,1248,1241,1233,1220,1193,1186,1165,1145,1135,1119,1112,1085,1064,1033,1016,995,958,953,950,943,932,927,916,903,902,902,896,891,888,881,862};
Length[Wordfreq];
citypop = Wordfreq;
ranks = {};
For[n = 1, n≤112, n++, ranks = AppendTo[ranks,n]];
both = {};
For[n=1, n≤ 112, n++, both = AppendTo[both,{citypop[[n]],n}]];
ListPlot[both]
logboth = {};
For[n=1, n≤ 112, n++, logboth = AppendTo[logboth,{Log[citypop[[n]]],n}]];
ListPlot[logboth]
loglogboth = {};
For[n=1, n≤ 112, n++, loglogboth = AppendTo[loglogboth,{Log[citypop[[n]]],Log[n]}]];
ListPlot[loglogboth]

x =Log[1.0 citypop]; 
y = Log[1.0 ranks];
Length[x]
numdo = 100;
xbar=Sum[x[[i]],{i,1,numdo}]/numdo;
sigmaxsq=Sum[(x[[i]]-xbar)^2,{i,1,numdo}]/numdo;
a=(numdo Sum[x[[i]] y[[i]],{i,1,numdo}]-numdo xbar Sum[y[[i]],{i,1,numdo}])/(numdo^2 sigmaxsq)
b=(-numdo xbar Sum[x[[i]] y[[i]],{i,1,numdo}]+Sum[x[[i]]^2,{i,1,numdo}] Sum[y[[i]],{i,1,numdo}])/(numdo^2 sigmaxsq)

Clear[bestfitword]; Clear[loglogboth];
bestfitword = {{11.03241887,0.350455347},{11,0.38469},{10.99,0.3952501},{10.98,0.4058102},{10.97,0.4163703},{10.96,0.4269304},{10.95,0.4374905},{10.94,0.4480506},{10.93,0.4586107},{10.92,0.4691708},{10.91,0.4797309},{10.9,0.490291},{10.89,0.5008511},{10.88,0.5114112},{10.87,0.5219713},{10.86,0.5325314},{10.85,0.5430915},{10.84,0.5536516},{10.83,0.5642117},{10.82,0.5747718},{10.81,0.5853319},{10.8,0.595892},{10.79,0.6064521},{10.78,0.6170122},{10.77,0.6275723},{10.76,0.6381324},{10.75,0.6486925},{10.74,0.6592526},{10.73,0.6698127},{10.72,0.6803728},{10.71,0.6909329},{10.7,0.701493},{10.69,0.7120531},{10.68,0.7226132},{10.67,0.7331733},{10.66,0.7437334},{10.65,0.7542935},{10.64,0.7648536},{10.63,0.7754137},{10.62,0.7859738},{10.61,0.7965339},{10.6,0.807094},{10.59,0.8176541},{10.58,0.8282142},{10.57,0.8387743},{10.56,0.8493344},{10.55,0.8598945},{10.54,0.8704546},{10.53,0.8810147},{10.52,0.8915748},{10.51,0.9021349},{10.5,0.912695},{10.49,0.9232551},{10.48,0.9338152},{10.47,0.9443753},{10.46,0.9549354},{10.45,0.9654955},{10.44,0.9760556},{10.43,0.9866157},{10.42,0.9971758},{10.41,1.0077359},{10.4,1.018296},{10.39,1.0288561},{10.38,1.0394162},{10.37,1.0499763},{10.36,1.0605364},{10.35,1.0710965},{10.34,1.0816566},{10.33,1.0922167},{10.32,1.1027768},{10.31,1.1133369},{10.3,1.123897},{10.29,1.1344571},{10.28,1.1450172},{10.27,1.1555773},{10.26,1.1661374},{10.25,1.1766975},{10.24,1.1872576},{10.23,1.1978177},{10.22,1.2083778},{10.21,1.2189379},{10.2,1.229498},{10.19,1.2400581},{10.18,1.2506182},{10.17,1.2611783},{10.16,1.2717384},{10.15,1.2822985},{10.14,1.2928586},{10.13,1.3034187},{10.12,1.3139788},{10.11,1.3245389},{10.1,1.335099},{10.09,1.3456591},{10.08,1.3562192},{10.07,1.3667793},{10.06,1.3773394},{10.05,1.3878995},{10.04,1.3984596},{10.03,1.4090197},{10.02,1.4195798},{10.01,1.4301399},{10,1.4407},{9.99,1.4512601},{9.98,1.4618202},{9.97,1.4723803},{9.96,1.4829404},{9.95,1.4935005},{9.94,1.5040606},{9.93,1.5146207},{9.92,1.5251808},{9.91,1.5357409},{9.9,1.546301},{9.89,1.5568611},{9.88,1.5674212},{9.87,1.5779813},{9.86,1.5885414},{9.85,1.5991015},{9.84,1.6096616},{9.83,1.6202217},{9.82,1.6307818},{9.81,1.6413419},{9.8,1.651902},{9.79,1.6624621},{9.78,1.6730222},{9.77,1.6835823},{9.76,1.6941424},{9.75,1.7047025},{9.74,1.7152626},{9.73,1.7258227},{9.72,1.7363828},{9.71,1.7469429},{9.7,1.757503},{9.69,1.7680631},{9.68,1.7786232},{9.67,1.7891833},{9.66,1.7997434},{9.65,1.8103035},{9.64,1.8208636},{9.63,1.8314237},{9.62,1.8419838},{9.61,1.8525439},{9.6,1.863104},{9.59,1.8736641},{9.58,1.8842242},{9.57,1.8947843},{9.56,1.9053444},{9.55,1.9159045},{9.54,1.9264646},{9.53,1.9370247},{9.52,1.9475848},{9.51,1.9581449},{9.5,1.968705},{9.49,1.9792651},{9.48,1.9898252},{9.47,2.0003853},{9.46,2.0109454},{9.45,2.0215055},{9.44,2.0320656},{9.43,2.0426257},{9.42,2.0531858},{9.41,2.0637459},{9.4,2.074306},{9.39,2.0848661},{9.38,2.0954262},{9.37,2.1059863},{9.36,2.1165464},{9.35,2.1271065},{9.34,2.1376666},{9.33,2.1482267},{9.32,2.1587868},{9.31,2.1693469},{9.3,2.179907},{9.29,2.1904671},{9.28,2.2010272},{9.27,2.2115873},{9.26,2.2221474},{9.25,2.2327075},{9.24,2.2432676},{9.23,2.2538277},{9.22,2.2643878},{9.21,2.2749479},{9.2,2.285508},{9.19,2.2960681},{9.18,2.3066282},{9.17,2.3171883},{9.16,2.3277484},{9.15,2.3383085},{9.14,2.3488686},{9.13,2.3594287},{9.12,2.3699888},{9.11,2.3805489},{9.1,2.391109},{9.09,2.4016691},{9.08,2.4122292},{9.07,2.4227893},{9.06,2.4333494},{9.05,2.4439095},{9.04,2.4544696},{9.03,2.4650297},{9.02,2.4755898},{9.01,2.4861499},{9,2.49671},{8.99,2.5072701},{8.98,2.5178302},{8.97,2.5283903},{8.96,2.5389504},{8.95,2.5495105},{8.94,2.5600706},{8.93,2.5706307},{8.92,2.5811908},{8.91,2.5917509},{8.9,2.602311},{8.89,2.6128711},{8.88,2.6234312},{8.87,2.6339913},{8.86,2.6445514},{8.85,2.6551115},{8.84,2.6656716},{8.83,2.6762317},{8.82,2.6867918},{8.81,2.6973519},{8.8,2.707912},{8.79,2.7184721},{8.78,2.7290322},{8.77,2.7395923},{8.76,2.7501524},{8.75,2.7607125},{8.74,2.7712726},{8.73,2.7818327},{8.72,2.7923928},{8.71,2.8029529},{8.7,2.813513},{8.69,2.8240731},{8.68,2.8346332},{8.67,2.8451933},{8.66,2.8557534},{8.65,2.8663135},{8.64,2.8768736},{8.63,2.8874337},{8.62,2.8979938},{8.61,2.9085539},{8.6,2.919114},{8.59,2.9296741},{8.58,2.9402342},{8.57,2.9507943},{8.56,2.9613544},{8.55,2.9719145},{8.54,2.9824746},{8.53,2.9930347},{8.52,3.0035948},{8.51,3.0141549},{8.5,3.024715},{8.49,3.0352751},{8.48,3.0458352},{8.47,3.0563953},{8.46,3.0669554},{8.45,3.0775155},{8.44,3.0880756},{8.43,3.0986357},{8.42,3.1091958},{8.41,3.1197559},{8.4,3.130316},{8.39,3.1408761},{8.38,3.1514362},{8.37,3.1619963},{8.36,3.1725564},{8.35,3.1831165},{8.34,3.1936766},{8.33,3.2042367},{8.32,3.2147968},{8.31,3.2253569},{8.3,3.235917},{8.29,3.2464771},{8.28,3.2570372},{8.27,3.2675973},{8.26,3.2781574},{8.25,3.2887175},{8.24,3.2992776},{8.23,3.3098377},{8.22,3.3203978},{8.21,3.3309579},{8.2,3.341518},{8.19,3.3520781},{8.18,3.3626382},{8.17,3.3731983},{8.16,3.3837584},{8.15,3.3943185},{8.14,3.4048786},{8.13,3.4154387},{8.12,3.4259988},{8.11,3.4365589},{8.1,3.447119},{8.09,3.4576791},{8.08,3.4682392},{8.07,3.4787993},{8.06,3.4893594},{8.05,3.4999195},{8.04,3.5104796},{8.03,3.5210397},{8.02,3.5315998},{8.01,3.5421599},{8,3.55272},{7.99,3.5632801},{7.98,3.5738402},{7.97,3.5844003},{7.96,3.5949604},{7.95,3.6055205},{7.94,3.6160806},{7.93,3.6266407},{7.92,3.6372008},{7.91,3.6477609},{7.9,3.658321},{7.89,3.6688811},{7.88,3.6794412},{7.87,3.6900013},{7.86,3.7005614},{7.85,3.7111215},{7.84,3.7216816},{7.83,3.7322417},{7.82,3.7428018},{7.81,3.7533619},{7.8,3.763922},{7.79,3.7744821},{7.78,3.7850422},{7.77,3.7956023},{7.76,3.8061624},{7.75,3.8167225},{7.74,3.8272826},{7.73,3.8378427},{7.72,3.8484028},{7.71,3.8589629},{7.7,3.869523},{7.69,3.8800831},{7.68,3.8906432},{7.67,3.9012033},{7.66,3.9117634},{7.65,3.9223235},{7.64,3.9328836},{7.63,3.9434437},{7.62,3.9540038},{7.61,3.9645639},{7.6,3.975124},{7.59,3.9856841},{7.58,3.9962442},{7.57,4.0068043},{7.56,4.0173644},{7.55,4.0279245},{7.54,4.0384846},{7.53,4.0490447},{7.52,4.0596048},{7.51,4.0701649},{7.5,4.080725},{7.49,4.0912851},{7.48,4.1018452},{7.47,4.1124053},{7.46,4.1229654},{7.45,4.1335255},{7.44,4.1440856},{7.43,4.1546457},{7.42,4.1652058},{7.41,4.1757659},{7.4,4.186326},{7.39,4.1968861},{7.38,4.2074462},{7.37,4.2180063},{7.36,4.2285664},{7.35,4.2391265},{7.34,4.2496866},{7.33,4.2602467},{7.32,4.2708068},{7.31,4.2813669},{7.3,4.291927},{7.29,4.3024871},{7.28,4.3130472},{7.27,4.3236073},{7.26,4.3341674},{7.25,4.3447275},{7.24,4.3552876},{7.23,4.3658477},{7.22,4.3764078},{7.21,4.3869679},{7.2,4.397528},{7.19,4.4080881},{7.18,4.4186482},{7.17,4.4292083},{7.16,4.4397684},{7.15,4.4503285},{7.14,4.4608886},{7.13,4.4714487},{7.12,4.4820088},{7.11,4.4925689},{7.1,4.503129},{7.09,4.5136891},{7.08,4.5242492},{7.07,4.5348093},{7.06,4.5453694},{7.05,4.5559295},{7.04,4.5664896},{7.03,4.5770497},{7.02,4.5876098},{7.01,4.5981699},{7,4.60873},{6.99,4.6192901},{6.98,4.6298502},{6.97,4.6404103},{6.96,4.6509704},{6.95,4.6615305},{6.94,4.6720906},{6.93,4.6826507},{6.92,4.6932108},{6.91,4.7037709},{6.9,4.714331},{6.89,4.7248911},{6.88,4.7354512},{6.87,4.7460113},{6.86,4.7565714},{6.85,4.7671315},{6.84,4.7776916},{6.83,4.7882517},{6.82,4.7988118},{6.81,4.8093719},{6.8,4.819932},{6.79,4.8304921},{6.78,4.8410522},{6.77,4.8516123},{6.76,4.8621724},{6.75,4.8727325}
};

loglogboth = {{11.03241887,0},{10.28844378,0.693147181},{10.19679129,1.098612289},{9.981651574,1.386294361},{9.809945808,1.609437912},{9.69793831,1.791759469},{9.294221856,1.945910149},{9.20853875,2.079441542},{9.142382679,2.197224577},{9.13086417,2.302585093},{9.090993614,2.397895273},{9.037414537,2.48490665},{8.896724917,2.564949357},{8.847072313,2.63905733},{8.826147399,2.708050201},{8.801469471,2.772588722},{8.791029857,2.833213344},{8.775703887,2.890371758},{8.536211197,2.944438979},{8.47428569,2.995732274},{8.462737006,3.044522438},{8.456806041,3.091042453},{8.439447843,3.135494216},{8.438799124,3.17805383},{8.433594168,3.218875825},{8.428799041,3.258096538},{8.401108712,3.295836866},{8.373784608,3.33220451},{8.362875831,3.36729583},{8.32700074,3.401197382},{8.243019469,3.433987204},{8.240648863,3.465735903},{8.221210094,3.496507561},{8.217978203,3.526360525},{8.182559264,3.555348061},{8.157657015,3.583518938},{8.14031554,3.610917913},{8.110126802,3.63758616},{8.079308192,3.663561646},{8.00836557,3.688879454},{7.938088727,3.713572067},{7.895808377,3.737669618},{7.866338923,3.761200116},{7.860570786,3.784189634},{7.844240718,3.80666249},{7.836764783,3.828641396},{7.821242084,3.850147602},{7.81197343,3.871201011},{7.798112629,3.891820298},{7.770223204,3.912023005},{7.763871288,3.931825633},{7.688455357,3.951243719},{7.643482907,3.970291914},{7.628031127,3.988984047},{7.58171964,4.007333185},{7.545918151,4.025351691},{7.492760301,4.043051268},{7.480992163,4.060443011},{7.45760929,4.077537444},{7.445417557,4.094344562},{7.445417557,4.110873864},{7.428333194,4.127134385},{7.407924323,4.143134726},{7.398786275,4.158883083},{7.397561536,4.17438727},{7.374629015,4.189654742},{7.353081921,4.204692619},{7.340835554,4.219507705},{7.340835554,4.234106505},{7.329749689,4.248495242},{7.329093736,4.262679877},{7.268223021,4.276666119},{7.232010332,4.290459441},{7.231287004,4.304065093},{7.218176838,4.317488114},{7.202661197,4.33073334},{7.197435354,4.343805422},{7.168579897,4.356708827},{7.152268856,4.369447852},{7.150701458,4.382026635},{7.134093721,4.394449155},{7.129297549,4.406719247},{7.123672785,4.418840608},{7.117205503,4.430816799},{7.106606138,4.442651256},{7.084226422,4.454347296},{7.07834158,4.465908119},{7.060476366,4.477336814},{7.043159916,4.48863637},{7.03438793,4.49980967},{7.020190708,4.510859507},{7.013915475,4.521788577},{6.989335266,4.532599493},{6.96979067,4.543294782},{6.940222469,4.553876892},{6.923628628,4.564348191},{6.902742737,4.574710979},{6.864847778,4.584967479},{6.859614904,4.59511985},{6.856461985,4.605170186},{6.849066283,4.615120517},{6.837332815,4.624972813},{6.831953566,4.634728988},{6.820016365,4.644390899},{6.805722553,4.65396035},{6.80461452,4.663439094},{6.80461452,4.672828834},{6.797940413,4.682131227},{6.792344427,4.691347882},{6.788971743,4.700480366},{6.781057626,4.709530201},{6.759255271,4.718498871}
};

ListPlot[{loglogboth,bestfitword}]