home | services | products | resources | forum
 
about us | contact   
Particle
February 11th, 2019



www.theparticle.com
Main
Services
Products
Resources
Forum
About Us
Contact

Particle Revelation
Hardware Destruction
Quotes
Humor [alpha]
Murphy's Laws

Programming
Java
Java Data Structures
C# Data Structures
Database Design
Graphics Tutorial
Artificial Intelligence

Downloads
SQLRunner
Graphics Tutorials
Hacking Tutorials
Java Applets
MIDI Music
Gov & Misc Docs

Games
Chess Game
Asteroids
Tic-Tac-Toe
Tetris

Applets
DRAW!
FlightBox
pWobble 3D
pRunner
NYU HWs
Swarms
Geometry
Chaos
Machine Learning

Academic
CISC 7510/7512
CISC 7334
DataSci (old)
OS (old)
AI (old)
App Dev (old)
C++ (old)
OOP (old)
Web (old)
Perl (old)
DBMS (old)
Perl (old)
ProgLangs (old)
PHP (old)
MltMedia (old)
Oracle (old)

Misc
Privacy Policy
Publications
profphreak.com


www.theParticle.com
Welcome to www.theparticle.com. It's the newest pre-IPO dot bomb that's taking the world by storm. Now is a perfect time to buy lots of worthless and overpriced shares!
     What this site is about?

Internet is becoming more and more polluted with junk-mail, people selling crap, and businesses which don't know their place on the net. They're all trying to make this wonderful place (i.e.: the net) in to hell (i.e.: real world). Internet should be viewed as a place of imagination, creativity, and most of all: fun. Internet is not some really advanced tool for searching for people to rip-off. It's about searching, and finding, things which are useful, helpful, and promote the sharing of ideas. This is what this site is striving to become.

News, Updates, & Rants...

     February 4th, 2019

Caught something on the weekend---passed out the whole day Monday.

- Alex; 20190204
February 4th at wikipedia...

     February 3rd, 2019

Visited some of the Catskills trailheads---such as Peekamoose mountain. Can't realy hike with a 1-year-old... just click some neat snowy pix.

- Alex; 20190203

     February 2nd, 2019

Spontaneously decided to spend the weekend upstate---in the Catskills. Booked a hotel (with a pool), and within a few minutes, we were on the way there.

- Alex; 20190202

     January 31st, 2019

Wow: Stock Exchanges to Fire Company Building Stock-Market Supercomputer: Finra to take over the Consolidated Audit Trail from Thesys Technologies. Wow! All those years of trying to get this thing, and now... wow, just like that.

- Alex; 20190131

     January 28th, 2019

...and back in NY.

Also, classes start tonight, and I'm a jetlagged zombie running on caffeine :-)

- Alex; 20190128

     January 27th, 2019

Drive drive drive to Delhi...

- Alex; 20190127

     January 26th, 2019

Kiddo's belated b-day party.

- Alex; 20190126

     January 25th, 2019

Kiddo's ceremonies.

- Alex; 20190125

     January 19th, 2019

Arrived in Delhi, and drive drive drive to Ambala.

- Alex; 20190119

     January 18th, 2019

...and off to India I go. At the Air India checkin counter, they assigned a middle-of-the-row seat to me, when I'm pretty sure I pre-paid for the extra-leg-room seat. Naturally I didn't have a reciept, and had to dig up my credit card bill (online) just to prove that there was a charge on the credit card from air-india for the seat. Sp what happened is that they gave up my seat to someone else... and apparently gave an extra leg-room seat to someone else for free, and had to move that other passenger and give me their seat.

That seat hassle wasted about an hour of time, so by the time I got through security the flight was already boarding :-/

- Alex; 20190118

     January 14th, 2019

... and back in NY :-)

- Alex; 20190114

     January 13th, 2019

Yosemite wasn't as closed as I thought. Highway 120 (which I took from death valley to Yosemite) was actually closed---but then a bit farther north highway 140 was open and very accessible (no issues with snow). The rangers at the booth didn't collect fees, and were very helpful in letting visitors know what's open and where.

Bathrooms in the park are closed (as well as visitor centers). There's poop (almost certainly human) on the trails---so there's that. What did they expect when they closed bathrooms?

Anyway, didn't spend much time in the park. Did a short walk to the lower yosemite waterfall, clicked some pictures from the valley, and headed out.

Visited a few friends in SF area, and headed to airport.

- Alex; 20190113

     January 12th, 2019

Got to SF, and with a bit of hindsight, upgraded the rental car to a Jeep to avoid repeating last week's incident. Headed to the Telescope Peak trailhead.

...and guess what, about 12 miles or so from the trailhead, the road is closed. As in the gate is closing the road. Stupid government shut-down!

Seeing that I can't do telescope peak (if I walk up the road, that will mostly double the length of the hike, and triple elevation gain, and I only have one day for this day-hike, so no feasible), decided to do a tour of death valley---starting with a visit to the Racetrack (got a jeep, might as well use it).

Many roads in the park are closed. Drive ins to places like sand dunes are closed---because the public toilets (which are essentially a hole in the ground) are ``overflowing''. Most places in the park are accessible though (can park on the side of the road and walk).

The Racetrack road is open. Set the jeep into 4wd-low mode, and headed down the road at barely-safe pace. That road from the pavement to racetrack takes about 40 minutes---keeping that barely-safe speed.

Here's a tip to driving off-road: set car into 4wd-low mode (by going through neutral; this is the same process that's on the toyota 4runner). Then, maintain 30-50mph speed limit. Anything below that means lots of bumps (the slower you go the more bumpby the ride). Anything above that is way too fast... It's important to realize that 4wd helps in acceleration, not stopping. So if you're approaching a curve at 40mph that you feel isn't "safe" at that speed, the natural reaction is to tap on the breaks (which will probably skid you into the curve). The correct thing to do is to tap the accelerator and steer into the curve, that way you're using your 4wd acceleration (and traction) to go in the direction you want to go, instead of skidding to a stop into side side of the curve... It takes a bit of practice, but you can float into curves at great speed just by using accelerator and the natural drag/friction of the road for stopping (e.g. do not use car breaks---think of breaks as going back to 2wd mode).

Anyways, at the Racetrack, couldn't find rocks with trails. Or at least couldbn't find many. Maybe it was just the lighting conditions, or that it rained recently, but most rocks there didn't have a trail. Very different from previous visits.

Fron there, decided to do the west-side-road. That's the road that goes behind the badwater basin---I never had enough time to do it, and this weekend is going for a toss anyway, might as well just drive it. It's not very exciting. It's just a dirt road similar to the racetrack road, but without the neat sightseeing at the end. Oh, and goes on for 3-hours! Yes, that west-side road is damn long!

Seeing that the weekend was mostly wasted on death valley road trip, decided to drive to Yosemite to see if there's anything there. Fully expecting the roads to be closed :-)

- Alex; 20190112

     January 11th, 2019

Flying out to SF, planning to hike Telescope Peak in death valley. Bringing snow shoes, snow hiking gear, etc.

- Alex; 20190111

     January 7th, 2019

...and back in NYC! :-)

- Alex; 20190107

     January 6th, 2019

The following morning a bit more snow fell. Woke up in the ``snowed in'' car. Had a few snacks for breakfast, and waited for the ranger to show up, which he did very promptly. He took me for a ride around the park, checking all the trailheads, all the camp sites, etc., everything for any other visitors. Apparently there was one crazy person to camp out (probably down by the colorado river) on that night. No other visitors in the park.

It's amazing, but the park rangers actually keep track of who is the park during these times. e.g. while riding along in the car, they keep track of what kind of car entered the park, whether there were tracks leading into the park, etc., very perceptive. In retrospect, I think they would've spotted my stuck car in the morning while they were doing their rounds of the park (they pretty much toured all the accessible roads of the park---unless you went well into the wilderness, they would've spotted the car or tracks). They probably wouldb't know what state the park visitor was in unless they noticed the actual vihicle, etc., but it's still neat that they try to keep a tally of who is in the park and where.

The park ranger called the towing company, and that was many many hours away (because they were busy pulling folks out of the snowstorm elsewhere). In the mean time, I got to spend the day riding along... and getting to experience some of their day-to-day tasks. Among which was cow herding. Occasionally, the neighbouring ranch cows get out from their enclosure and get into the park. The park rangers try to get those cows back into the correct place... moslty by intimidating the cow back into the enclosure. So I helped chase a cow back into the ranch... if it's more than a few (more than a single ranger can handle), they call the ranch to bring in the actual cowbosy (on horses!) to round up the wondering cows (so after managing to get 1 into the enclosure, we spotted dozen or so outside, and for those ranger called in the ranch for help).

Late in the afternoon the tow company folks showed up, in a pickup truck. Pretty much the same kind of pickup tuck the park rangers use. Anyway, we (the park ranger and I) escorted them to the car, where they attached a cable to the back wheel, and the other end to the rear tow wench of the truck---while one of the tow buys was in the car steeering right, the other one was in the truck pulling on the back right wheel.

All three wheels of the car went in the air, and the car was pretty easily pulled out of the ditch (sort of weird, because it had be put a bit more into the ditch to be taken out of the ditch); I was free of the snow!, and getting late for the flight back. So I paid the tow company, etc., and drive drive drive to Salt Lake City for the flight which I thought I'll have to miss...

Made it to the flight, all is well.

Note to self, if it's snowing or any off-road (dirt-road) driving, then get a 4-wheel-drive car next time. It's cheaper than being pulled out of a ditch in some remote place.

- Alex; 20190106

     January 5th, 2019

Arrived in Salt Lake City, and after a hour-wait long inside the airplane (there was no available gate to de-plane the airplane), set out to drive to Needles (the south-eastern part of Canyonlands).

For the trip, rented a Toyota Corolla, which was an awesome car---it has automatic high-beams... so it turns them on when needed, and turns them off when there's oncoming traffic. That was pretty neat. Also had adaptive cruize control, so if the car in front slows down or stops, the car will automatically slow down and stop, etc. I want that in my future car.

Anyways, got to Needles very very early, and... it's snowy. There's actually snow in Needles! Not too much, but about 4-6 inches everywhere. Proceeded to the trailhead at Elephant Hill---which is just a few miles down a very twisty steep dirt road.

So far, there was only 1 other car that I've seen in the entire park. I think the government shutdown and the fact that it's a snowy weekend had something to do with that. The visitor's center is closed---even the bathroom is closed.

For the hike doing the "usual" loop: elehpant hill to druid arch, then to joint trail, then to confluence point, then back to elephant hill. Started around 7 in the morning, and ended around 10-sh PM (it's not easy to walk over snowy trails).

Anyways, after getting back, started to drive out, and on that snowy twisty dirt road, the car stalled. On one particuarly steep hill, about middle of the way up, the front wheels slipped, and the car slid downhill, with it's rear wheels going into a ditch on the side of the road. (good thing it went into the left side of the road, as opposed to off-the-cliff on the right side of the road).

Getting a Corolla (front wheel drive) out of a ditch with only 1-front-wheel semi-on-the-road (which is covered in snow that made the whole car slip downwards) isn't easy. I tried everything. Car mats. Rocks. Even clearing snow under the tire. Moving forwards and backwards, etc. I even tried lifting the car... first by hand (yeah, didn't get far---a car is surprisingly heavy, couldn't even make it move with all my weight), then with car jack. Jack up the car, put a rock under the wheel, and then jack up again, etc. That didn't work--- the road is just too slippery.

After fiddling with things on trying to get the car out, gave up, and headed out in search of help. The other alternative was to stay in the car over night (and hope there's someone there in the morning). This being a remote dirt road of a fairly remote park, during a govermnet shutdown (I'm thinking no-rangers-on-duty kind), I thought I need to find my own way out instead of sitting and waiting for help.

So headed towards visitor's center. That's one long-walk. On a snowy night. After walking the entire day :-/

The visitor's center got nobody. It's closed. The park map has some residential-looking-streets, so headed towards those. Most things in those streets turned out to be warehouses. But after a few miles, there were actual houses... (my guess, for park staff). But most of those looked empty---probably due to government shutdown :-/

After knocking on about 20 doors, one house had a barking dog, and the owner was one of the few park rangers that was still on duty during the gov shutdown. So after midnight, the park ranger (lets call him Bill; not his real name) and I, went to try to get my car out.

Funny thing about Corollas... they have no attachment points. There's no hooks on the front, and there's no tow thing on the back, so we didn't know what to attach the wench to. So with that, Bill gave me supplies (MRE food, sleeping bag, water, etc.) and I camped-out (inside-the car) overnight.

- Alex; 20190105

     January 4th, 2019

Flying out to Utah; will hike in Canyonlands :-)

- Alex; 20190104

     January 1st, 2019

Happy New Year!

- Alex; 20190101

     December 15th, 2018

Decided to upgrade the graphics card too---got Nvidia RTX 2080. Unfortunately Linux mint (ubuntu) doesn't recognize it out of the box, and had to go through quite a bit to install the proper drivers. In order to install the official nvidia drivers need to kill X server, and doing that isn't as simple as it used to be... it just pops back up as soon as it dies. Need to disable the service, etc.

- Alex; 20181215

     December 6th, 2018

Got Cooler Master ML360 RGB CPU Liquid Cooler to cool the Threadripper. Installed everything and it seems everything works without issues. The only thing needed was to adjust ram speed in BIOS.

- Alex; 20181206

     December 5th, 2018

Rebuilding my home server. Basic config is AMD Threadripper 2990 with 128gig ram. One component I got that didn't work was: Corsair H115i PRO RGB (the liquid cpu cooler). In newegg website said it was compatible with TR4 socket, and it wasn't. Getting another liquid cooler shipped overnight.

- Alex; 20181205

     November 26th, 2018

...and back in NYC :-)

- Alex; 20181126

     November 25th, 2018

Visiting Badwater in Death Valley National Park.

- Alex; 20181125

     November 24th, 2018

Visiting The Racetrack in Death Valley National Park.

Here's something to try while there: run really really fast with eyes closed. It's a very weird feeling not knowing what's ahead and yet running at full speed.

- Alex; 20181124

     November 23rd, 2018

Doing a tiny hike in Bryce National Park.

- Alex; 20181123

     November 22nd, 2018

Flying out to Las Vegas :-)

- Alex; 20181122

     October 31st, 2018

Happy Halloween!!!

The future is not set. It doesn't exist until it happens. We remember the past, we don't remember the future. Yet past somehow seems to exist, we can refer back to it, we can look at and study historical events, etc. But is there really that much difference between the past and the future?

Whatever we know about the past is actually a recording. Unless we have something memorized in the present, then we don't know about it from the past. If there was an event in the past that nobody recorded, then it's just as mysterious to us as the event happening in the future. We can guess at the probabilities, etc., but in studying the past, only the present matters.

Whenever a recording device is involved, there's some bitrate---speed and accuracy with which it can record information. Similarly, there's a retrieval rate. The univesal recording device cannot possibly be recoding everything: it is very observer centric: unless an observation was made, then the event could've happened any possible way.

For example, an electron going through the double-slit experiment: if we record which way it goes, we have made an observation and a recording. We can refer back to that path later by saying ``yes, the electron went through the left slit''. But if we don't make a recording of which slit the electron went through, then the electron actually goes through all possible paths.

At a later stage, we cannot refer back to history and say ``ah, but if we look at the history (refer to the past), then the electron went through the left slit'', because there's no history, and we don't have a recording of it in the present... So as far as ``history'' is concerned, the electron went through all possible paths.

The same applies to the future. If we send an electron through a double slit experiment and explicitly don't look/make observations/recordings, then it appears to actually go through both slits. If we setup the experiment to check which way it goes, then it goes through the slit we observe, randomly of course. If it wasn't random, then there would be no point in recording the information (it would not be `information').

What would the universe without observations look like? Imagine if nothing was ``recorded'' in the present. Time would appear to stand still. In fact, it wouldn't ``appear'' anything, it just wouldn't be anything. So for time to move, events need to be observed and recorded.

Lets look at the dead cat in the box. A cat is locked in a box with some poison. A random event (truly quantum-random) may release the poison. Now, in our macro world, the cat is either dead OR alive. We don't know which one until we open the box. In the quantum world, the cat is "both" dead AND alive (it has yet-to-be-observed histories of it dead AND alive). There's no information yet. If the cat behaved like the electron flying through the left or right slit, then technically it would be flying through "both", which is hard to imagine for a macroscopic object like a cat in a box.

But what's the process by which the past gets recorded and gets turned into the present? How many bits of information can the present hold? (we've already seen that we cannot record ``everything''). Is that number of bits constant, or does it expand as we make observations?

If it's constant, then making left-or-right slit observation must ``forget'' some recorded bit somewhere. Perhaps the universe leaks bits on the edges (or black holes?).

- Alex; 20181031

     October 29th, 2018

Below are my views and do not reflect the opinions of anyone else:

Valuations: there are several ways of evaluating investments. For example, bonds give us a very direct way of evaluation: a bond pays us a well defined interest---so there are only three things we have to worry about: whether the bond will eventually be repaid, interest rates, and inflation.

In case of government (and many municipal) bonds, we don't need to worry about default, and in many cases inflation is correlated with interest rates, so there's only one thing we really need to worry about. High future interest rates means that our bonds lose value and vice versa.

If we expect interest rates to go higher, locking in a rate via a bond is a bad idea (on the flip side, borrowing at a low rate is generaly a good idea).

Bonds of corporations are best avoided altogether. Ask yourself, if you had a company and you needed to raise capital, which one would you issue, bonds or stock? The mathematics are pretty straight forward: if you expect to earn a bigger return than the interest you pay, you issue bonds, otherwise you issue stock.

In other words, if the company is sound, and they're issuing bonds, you'd make a better return from stocks. If the company isn't sound and is issuing stock, then you'd better avoid the stocks of such a comapny. Never buy bonds (or stock) if you believe the company is on its last leg. (unless you think they're a buyout target, or if liquidation of the company is expected to bring in more than the price).

For stocks, the evaluation is a bit tricky.

We can take the bond approach: treat equity as a contract that pays us some ``interest'' (dividend) every so often until the end of time. How much are those infinite dividends worth?

Money today is worth more than money tomorrow. Two in the bush vs one in the hand.

So we pick some reasonable discount rate (often approximately the current interest rate), and discount all the future dividends by that rate until we hit zero. The sum of all such payments is what the contract is ``worth'' (this is essentialy how much gain we expect to get out of the contract over its entire lifetime). Note that there's no principle in this scenario---there's just dividends, and nothing else. So that's the only thing we use to evaluate the worth of a stock certificate.

For example, if a company pays us $1 in dividends this year, and we expect that to continue, and we also expect interet rates to be about 3% or so (which is historically very low), we can say that each share is worth about: $30.

Obviously the price of each share could be $45 in the market. Or it could be $25. The $30 number just says if you look at dividend alone, you really shouldn't pay more than that. In this scheme, you ignore the fact that you could potentially sell the share for $45 next year: the basic idea is that if you owned the share for a lifetime, what financial benefit you would get from the company because of said ownership.

Many companies don't pay dividends. We could say such comapnies are worth exactly $0 (as we don't benefit from being the shareholders).

We could also use a proxy measure: earnings. Assuming earnings are reinvested and build up value of the company, each share should gain by the amount of the earnings. Discounted into the future of couse.

For example, if our company made $2 per share, how much would we expect such earnings to be worth? Lets assume 5% discount rate, or about $40 price.

Why did we use 5% for earnings and 3% for dividends? Guesses. But generally we should discount earnings at a higher rate than dividends, as money in our pocket is worth more than money in someone else's pocket. (money that we control is worth exactly what it is, but if some greedy/incompetent manager is in charge of our money, it's worth much less than the actual dollar amount).

In the above, valuation we ended up with P/E of 20. (price/earnings, 40/2).

Let's pretend that we had almost a decade (from 2008 til 2017) of extraordinary low rates (0-1%), and the discount that many analysts used was 1%. That company that earned 2$ a share would ``demand'' a $200 share price, or P/E in the 50-100 range.

Then Fed steps in and tightens the rates to 2%, now our valuation should point towards a $100/share price. But the intersia in the market keps markets afloat at $200.

The Fed tightens things a bit more: rate is 3%. Now that $2 earnings demands only $66 or so share price. The market is still up: the stock is still priced at $200.

Let's put this in perspective: if we buy a government bond at 3% (the 10 year treasury bond), we'd expect a higher return on our money than buying that $2 earnings for $200.

Yes, earnings could come up. But they could also come down. If a comapny has been earning $2 a year for a while, bumping that up to $4 is hard. Many companies are already optimize and squeezed quite a bit... bot pulling out more earnings out of the same process is difficult.

What happens when rates go to 4%?

That's why the market panics every time the Fed bumps up the rate number. Nobody wants to be the last one holding those shares at $200 when they fall back to $40 or so.

Revenue is another thing folks have used to evaluate stocks. But we got to be careful: revenue isn't the same as profit. High revenue could mean high losses.

Large enterprises with no earnings (and no dividends) is another thing to look out for. Yes, the company could be putting everything its got back into research and development (which often increases company value)---or they could be lavishly rewarding the management or funding go-nowhere projects or badly concieved aquisitions.

- Alex; 20181029

     October 28th, 2018

Decided to rebuild the desktop. Tentatively thinking of AMD Threadripper as the CPU.

- Alex; 20181028

     October 7th, 2018

My primary desktop quit. It shutdown, and now no indication of life when I press the power button. The board is getting power (there's a small LED on the board, but that's about it. No fan. No disk spin, nothing. Seems completely dead :-/

- Alex; 20181007

     October 5th, 2018

Happy B-Day to yours truly :-D

- Alex; 20181005

     October 2nd, 2018

Finished reading The Book of Why: The New Science of Cause and Effect by Judea Pearl and Dana Mackenzie. This is definitely an interesting book to read. Not sure I agree with everything in it, but it's worth putting this on your to-read list (if you're into such things).

Basically the language of statistics doesn't include causation. If two things appear to happen together, or one after the other, no matter how closely, there's no way to precisely state that one causes the other using the language of statistics. Correlation does not imply causation. From the observational data perspective, we just get points in N dimensions---and just from that data alone it's impossible to say which dimension causes the other (all we can say is how values are correlated).

Anyway, the book makes an attempt at defining causation. Essentially there's a concept of conditional probability: P(Y|X), which is probability of Y given that X has happened. This does not in any way imply that X causes Y, in fact this could be flipped using the Bayes rule. What the book defines is the "do" operator. In other words: P(Y|do(X)), which is the probability of Y given that we "do" X (we force it, we don't just let nature run its course).

The situations where P(Y|X) != P(Y|do(X)) are exactly the instances where doing X causes Y. Counterfactually, not doing X wouldn't "cause" Y.

The book doesn't clearly define the "do" operator, and I'm not sure if that's intentional or not (it's not a techy book). The do operator is explained in words as: we fix the value of X, while leaving everything else run their course---that way any influence on Y from fixing X would be only due to fixing X and not some confounded variable.

The book is full of very interesting examples and stories regarding misuse of causation vs correlation. It's also full of author's opinions, which sometimes do become a drag on the text (and mostly explains why some reviewers gave this book low marks). The author often comes off as I'm so clever and great, and my approach solves problems that all these other researchers completely screwed up. Or something like that. The tone of the book starts out OK, but gets like that someplace in the middle.

All that said, we're assuming that there really is such a thing as causation, which isn't supported by all the physical laws, quantum mechanics, nor anything in mathematical language. Relativity just needs a four-dimensional space-time, but as for cause-effect things can just happen in any order---everything is just a curve in space-time.

- Alex; 20181002

     October 1st, 2018

Happy Birthday... you know who you are.

- Alex; 20181001

     September 30th, 2018

Visiting the liberty bell :-)

- Alex; 20180930

     September 29th, 2018

Driving out to Philadelphia---gonna see the liberty bell :-)

- Alex; 20180929

     September 23rd, 2018

Cut my finger while shaving :-/. The blade slipped out of my hand, and while trying to catch it (yeah, wasn't a smart idea), sliced a chunk of my finger off.

- Alex; 20180923

     September 19th, 2018

Ahoy, maties! International Talk Like a Pirate Day! Arr...

In other news, did an MRI of my knee. So for the MRI, they asked, ``what music would you like to listen to'', and I just said anything, so they gave me headphones with classic music... but then that machine went clunk-clunk, chung-chung, dang-dang, bang-bang, clunk-clunk, etc., for about 40 minutes. Can barely hear anything. If I ever get one of these things again, I'll ask for heavy metal.

- Alex; 20180919

     September 15th, 2018

Re-subscribed to World of Warcraft for a bit (pre-ordered the expansion, but haven't logged in yet).

- Alex; 20180915

     September 12th, 2018

Finished reading Measurement by Paul Lockhart. This is one amazing book. Wish I read it during my high school years.

- Alex; 20180912

     September 11th, 2018

9/11: It's that time of the year again.

- Alex; 20180911

     August 31st, 2018

Went to doc for the knee. Did X-ray, and ``nothing serious''. Still hurts though. Scheduling MRI :-/

- Alex; 20180831

     August 24th, 2018

Think last week's hike hurt my knee. It's been bothering me since the hike, today more than before :-/

- Alex; 20180824

     August 23rd, 2018

Crazy thoughts: been thinking about connection between n-tuple method and quantum mechanics. If we make n large (in n-tuple) then we get more precise results, but less generalization. If we make n=1, then we get average behavior. The link to quantum mechanics is that if we're only working with one quantum system, we get average behavior, but if we're working with many particles, we get some sensible predictable power. (e.g. we can predict how masses will fall down to earth because they're made up of many many particles... but at individual atom level that's hard... same for n-tuple method, we can do prediction based on a large n-tuple, but if n=1 then prediction only goes as far as overall average).

- Alex; 20180823

     August 19th, 2018

Hicking up Mnt.Washington. 3-hours up via Boot-Spur trail, 1-hour on top (loop around Lake, and upto summit building, and 2-hours down via Lion's Head trail.

Much of the Tuckerman trail is actually closed, and there's a detour via a VERY steep road that just seems to go up up up (or down-down-down). It's shorter than the trail, but it's much harder to walk down on.

- Alex; 20180819

     August 18th, 2018

Driving out to Mnt.Washington.

The mountain is all foggy. Drove upto summit, and there's no view. Very cold and wet :-/

At the fancy hotel, Suneli found a bullet under one of the shelves.

- Alex; 20180818

     August 17th, 2018

Finished reading The Three-Body Problem by Cixin Liu, Ken Liu (Translator). This book is... well... different. It's very very good.

Sometimes a book has quite unique concepts and a story. Kind of like Einstein's Bridge by John Cramer. The Three Body problem is kind of similar... very deep and unique SciFi.

Definitely recommend.

- Alex; 20180817

     August 15th, 2018

Kiddo doc appointment day. Leaving early for the 8am appointment. As merging into LIE, right past exit 19, was changing lanes, checked the side mirror and blind spot, and at that instant the car ahead of me suddenly stopped.

Noticed it a bit too late. Slammed on break, and still rolled into the back. My front bumper got cracked, and the other car's metal bumper protector got damaged (no damage to the car itself). My bumper got fixed after a kick (it got a scratch on it now, but besides that, it's all good).

Pretty scary experience. Blocked two lanes on the LIE that morning (until it became apparent that this wasn't anything major). The other driver didn't speak english, so didn't understand me when I was asking whether I should call emergency. The cops never showed up. A passing-by state trooper stopped traffic and let both of us drive onto the shoulder.

Missed kid's doc pointment :-/

- Alex; 20180815

     August 6th, 2018

...and back in New York :-)

- Alex; 20180806

     August 5th, 2018

Back to Ambala, and then drive to Delhi airport.

- Alex; 20180805

     August 4th, 2018

Feeding cows at a cow sanctuary :-)

Getting to Noor Mahal Hotel, and enjoying swimming pool.

- Alex; 20180804

     August 3rd, 2018

Taking morning commuter train from Ambala Cantt to Chandigarh.

Visiting Chandigarh rose garden, and having cheesecake at Elante mall.

- Alex; 20180803

     August 1st, 2018

Morning mini-hike to Jakhoo temple.

Driving back to Ambala.

- Alex; 20180801

     July 31st, 2018

Driving to Shimla.

- Alex; 20180731

     July 28th, 2018

Landed in Delhi. Driving to Ambala.

- Alex; 20180728

     July 27th, 2018

Flying out to India.

- Alex; 20180727

     July 24th, 2018

Does Microsoft Surface Go tablet come with a prorprietary charger? (e.g. does it use USB-C for power like every other modern tablet these days, or does it require its own proprietary power adapter?).

In other news, a friend flying on Hawaiian airlines discovered that I'm mentioned by name in an in-flight magazine, in a story about Mauna Loa. ``Hona Hou!'' magazine, June/July 2018, Volume 21, No. 3. page 90 :-)

- Alex; 20180724

     July 20th, 2018

Given these numbers:
[50, 16, 5, 54, 1, 92, 42, 20, 63, 19, 29, 17, 75, 98, 99, 83, 84, 69, 8, 27, 71, 65, 30, 73, 69, 54, 37, 63, 46, 85, 54, 45, 36, 35, 93, 14, 26, 91, 22, 23, 0, 12, 58, 98, 34, 75, 51, 44, 61, 56]

The mean is: 49.44.
The mean of the first 20 is: 47.550.
The mean of the last 20 is: 48.238.
Mean of every even index is: 45.76, and odd indexes 53.12.

If we randomly pick out 20 numbers, what do you think the mean will be? Yep, about 50-ish.

With that in mind, we can estimate any integral (sum) by randoly sampling a few numbers.

- Alex; 20180720

     July 19th, 2018

Future Value = Present Value * (1 + rate)

If rate is 0.045 a year (4.5%), then the future value of $100 in a year is $104.50.

It works in reverse too. Present Value = Future Value / (1+rate).

A $100 a year from now is worth: 100/(1+0.045) = $95.694

If we raise (1+rate) to a power, we can calculate it over many years. e.g. A promise to pay $1000 in 18 years at 4.5% a year is worth: 1000/(1+0.045)^18 = $452.80 in today's dollars.

What rate would we need to turn $100 into $1000 over 18 years? We can solve for rate:
rate = (Future Value / Present Value)^(1/years) - 1
or (1000/100)^(1/18) - 1 = 0.13646, or 13.65%

We can check that, 100*(1+ 0.13646)^18 = $999.94

How many years would we need to get $100000 if we start with $1000 and expect a rate of 8% a year?

years = (log(future value) - log(present value)) / log(1+rate)
or (log(100000) - log(1000)) / log(1+0.08) = 59.838 years.

So far, we looked at interest that's compounded annually (the interest is added at the end of the year). What if it's compounded 4 times a year? Then the future value of $100 a year from now (at 4.5% interest) is:
100 * (1+0.045/4)^4 = 104.58, or
Present Value = Future Value / (1+rate/n)^n
where n is the number of compounding intervals.

Notice that 104.58 is greater than 104.50 we got before. So more frequent compounding makes more money. What if we compound continuously... like every nanosecond... (let n go to infinity). We get:
Future value = Present value * exp(rate * time)
where time is in years.

The future value of $100 a year from now (at 4.5% interest) is then
100 * exp(0.045*1) = 104.60

This works in reverse too... What's the present value of $5000 five years form now?
5000 / exp(0.045 * 5) = $3992.6

- Alex; 20180719

     July 18th, 2018

Berkshire has lifted restrictions on what they'd consider a fair price to buy back shares. Stock poped by 5%. Before, the limit was 1.2 book value: if share price fell below 1.2 times book value, the company would buy back their own shares. Now the limit is anyone's guess; perhaps 1.5 book value?

In either case, a company buying back shares is pretty ugly business. On one end, if the executives are doing it because they think they're cheap, then they're taking advantage of the shareholders (by using their own money to buy them out).

On the flip side, if executives are doing it irrelevant of the price (e.g. 1.5 book value maybe), then they're disadvantaging the existing shareholders buy overpaying the infated share prices.

So either case, the company is acting bad towards its shareholders.

With that in mind, it's more likely the company is buying them back because they're underpriced...

- Alex; 20180718

     July 17th, 2018

If we wanted to multiply two 2 digits numbers, AB * CD, we could start by changing the representation of the numbers... e.g. AB is actually A*10+B, and CD is actually C*10+D.

So to multiply AB*BC, the result is actually
(A*10+B) * (C*10+D) =
A*C*100 + A*D*10 + B*C*10 + B*D =
A*C*100 + 10*(A*D + B*C) + B*D =
x*100 + y*10 + z

where x=A*C, y=A*D+B*C, and z=B*D

There are several ways of computing A*D+B*C. First observe that
x+y+z = A*C + A*D+ B*C + B*D = (A+B)*(C+D)

So to get A*D+B*C we can just take (A*C + A*D+ B*C + B*D) - A*C - B*D, leaving only A*D+ B*C. We already have A*C and B*D calculated, as x, and z respectively. In other words:

y = A*D+B*C = (A+B)*(C+D)-x-z

The A*D+B*C has two multiplications, while (A+B)*(C+D)-x-z has one multiplication. So the total AB*CD multiplication can be done with 3 multiplications, and not 4 as in grade school algorithm.

And this can be used recursively for numbers that are bigger than 2 digits.

The above is known as the Karatsuba algoritm, and apparently it was invented in 1960.

- Alex; 20180717

     July 16th, 2018

If computer programming can be absracted away into implementing predicates, then every program is essentially defining a set of numbers.

In other words, { x | is_even(x) } defines a set of even numbers. There's a predicate is_even that defines this set. In previous rant (7/13) we've seen that any program (particularly those that return a numeric result) can be implemented as one that outputs a 0 or 1 value.

So every computer computer program defines a set.

Now, lets take the set of integers, and take a power set of it. What we get is a set of all subsets of all integers.

Looking back at the predicate view, each of these subsets is esesntially juset a binary number, indicating presense or absense of a value.

For example, is_even(x) may be represnted as:
010101010101010101010101010101010101010101...

Is divisible by 3 may be:
001001001001001001001001001001001001001001...

And divisible by 7 as:
000000100000010000001000000100000010000001...

We can combine them via:
010101010101010101010101010101010101010101... even
001001001001001001001001001001001001001001... divisible by 3
000000100000010000001000000100000010000001... divisible by 7
....
....

We can make this list as long as we want. count in binary.

Now take diagonal elements, and flip them:
[1]10101010101010101010101010101010101010101...
0[1]1001001001001001001001001001001001001001...
00[1]000100000010000001000000100000010000001...
....

Now, no matter how how many sets we've listed, the set represented by this diagonal isn't on the list... (this is called diagonalization).

In our case, it shows that there are subsets (or mappings) that cannot be represented by predicates. So the mappings/sets exist (superset of all integers has that diagonal set), but we cannot have a predicate define that set.

What kind of sets cannot be defined by predicates (computer programs). One of them is the halting program. In fact, there's an infinite number of such sets that cannot be defined by a program.

- Alex; 20180716

     July 13th, 2018

Normally computer problems are seen as turning inputs into outputs, where output can be any number.

For example, square function would take a number and return its square.

Also, inputs and outputs are arbitrary numbers (if the input is a file, then the input number is the contents of the entire file). Same for output.

Godel came up with a way to map list of numbers into a single number: lets say we wanted to represent list 45, 2, 23, 0, 5 as a number, we could take 2^45 * 3^2 * 5^23 * 7^0 * 11^5. Note that we can represent any list of numbers as a single number (by doing powers of the prime factors).

So computer programs map numbers to other numbers. Number in, number out.

What if we're limited to programs that can only output a single bit as input. In logic these are called predicates. Number in, 0 or 1 out.

Are those programs just as powerful as those that can produce any number as output?

For example, can we build a function such as square using nothing but functions that return one bit? Obviously we're allowed to call our predicate program multiple times.

So let us setup a predicate that looks like: is_square_over(x,n){ if(x*x > n) return true; return false;

How can we use this predicate to calculate square of x?

The simplest approach is to do a for loop, for(i=0;;i++) if(is_square_over(x,i)) return i-1;

But this for loop doesn't scale. If someone asks for square of 1000000 we would be looping for 1000000 times, while the square calculation is much simpler than that.

The trick is to find the uppwer bound on the output. Lower bound is already 0, the upper bound can start at 2, and then doubled until the predicate returns false.

Once we have the lower and upper bounds, we can do a binary search for the last instance where predicate returns false. It would look something like this:

sub square {
 my ($x) = @_;
 my $h = 1;
 while(is_square_overN($x,$h)){
  $h *=2;
 }
 my $l=int($h/2);
 my $cnt = ($h+1) - $l;
 while($cnt > 0){
  my $step = int($cnt/2);
  my $it = $l + $step;
  if(is_square_overN($x,$it)){
   $l = $it + 1;
   $cnt -= $step + 1;
  }else{
   $cnt = $step;
  }
 }
 return $l;
}

Peformance wise, the square implementation using the predicate isn't that much slower; factor of log difference.

- Alex; 20180713

     July 12th, 2018

We sometimes hear of folks writing programs to generate first N digits of pi. Where N is a million, etc. It seems we can write programs to produce digits of pi: If left running forever, it will produce correct digits of pi for as long as it's running. If left running forever, it will produce pi.

Now, given this program (in a black box), can we write another program to verify that it truly does produce pi? The verification program would need to generate its own digits of pi, and compare them against the output of the black box program. If it finds a wrong one, it returns false. But will it ever return true?

This is just another variation on the halting problem.

But what if the verification program just returns "no". Will it be correct?

Consider that the box is finite (there's only so many bits it can hold). Eventually any finite machine must fall into a loop---so any finite box that spits out digits of pi will eventually fail on some digit. Even a black box the size of the universe will not produce pi. So it's safe to return "no".

- Alex; 20180712


Or, you can directly go to a desired entry.
   




NOTICE: We DO NOT collect ANY personal information on this site.
© 1996-2016 by End of the World Production, LLC.