Monday, July 06, 2026

How the Rich Pay Less Tax

Workers pay taxes twice: first when they earn income and again when they spend it. Wealthy investors, by contrast, can avoid recognizing taxable income altogether. By borrowing tax-free against their assets (company shares, property, etc.) instead of taking a large salary or realizing capital gains, they can access cash without triggering an income tax bill. Paying an 8% sales tax on a new sports car can be far cheaper than selling appreciated stock or paying themselves enough income to buy it, which could also trigger income or capital gains taxes exceeding 20%.

Private yachts and jets are often owned through corporations, LLCs, or other legal entities rather than directly by individuals. Depending on the jurisdiction and how the asset is used, this structure may provide tax advantages, such as deferring or reducing sales taxes, VAT, or other business-related expenses. Simply owning an asset through a company, however, does not automatically eliminate those taxes.

Why do banks agree to this? Publicly traded stocks are highly liquid collateral. If the market declines, the bank can issue a margin call and, if necessary, liquidate enough shares to protect its loan. Banks also require conservative Loan-to-Value (LTV) ratios, for example, lending only 50% of the collateral's value, to create a substantial safety buffer.

At first glance, this strategy seems to have an obvious flaw. If someone continuously borrows to fund their lifestyle, won't they eventually have to sell their assets to repay the debt, triggering decades of deferred capital gains taxes?

Under current U.S. law, the answer is often no. When someone dies, most appreciated assets receive a "step-up in basis," meaning their tax basis is reset to their fair market value on the date of death. As a result, when the estate sells the shares to repay the bank loans, there is little or no capital gain remaining to tax, even if the assets appreciated enormously during the owner's lifetime.

That does not mean the estate escapes taxation entirely. Very large estates may still owe the Federal Estate Tax. However, the estate tax is calculated on the net value of the estate:

Net Estate = Total Assets − Total Liabilities

Outstanding loans reduce the taxable estate because debt is deductible. The estate can then use the proceeds from selling the stepped-up assets to repay the bank, leaving the remaining wealth to pass to the heirs with little or no capital gains tax on the appreciation accumulated during the deceased's lifetime.

The bank does not walk away completely tax-free. Over the decades, the billionaire’s loan has been accumulating interest. If the billionaire borrowed $100 million and the total debt grew to $150 million by the time they died, that extra $50 million is pure profit (interest income). The bank must report that $50 million as taxable corporate income and pay standard corporate income taxes on it. The billionaire never paid income tax on the borrowed $100 million, but he paid interest to the bank after his death.

The strategy is powerful, but it is far from risk-free.

A severe market downturn can trigger margin calls. If the borrower cannot provide additional collateral, the bank may force the sale of shares. Since the owner is still alive, the original cost basis applies, potentially creating a large capital gains tax bill. Selling additional shares to pay that tax can trigger even more taxes, creating a vicious cycle.

Borrowing costs are another major risk. These lines of credit typically carry variable interest rates tied to benchmarks such as SOFR. If interest rates rise while asset returns stagnate, the cost of servicing the debt can eventually exceed the portfolio's growth.

Liquidity is also critical. Interest payments must be made continuously. If a borrower's wealth is concentrated in a company that stops paying dividends or if banks become unwilling to extend additional credit, they can become "paper rich but cash poor," forcing them to sell appreciated assets and incur the taxes they had hoped to defer.

Finally, the entire strategy depends on the tax code remaining favorable. Because "Buy, Borrow, Die" has become widely discussed, proposals to limit or eliminate its advantages frequently appear in tax reform debates.

When markets appreciate steadily, borrowing costs remain manageable, and tax laws stay largely unchanged, Buy, Borrow, Die can preserve significantly more wealth than repeatedly selling appreciated assets. But the strategy rests on three pillars: rising asset values, continued access to cheap credit, and favorable tax rules. If any of those pillars fail while the borrower is still alive, leverage can quickly transform from a wealth-preservation tool into a substantial financial liability.

Wednesday, July 01, 2026

Sunshine: What your skin feels vs what it sees

We naturally associate sunlight with warmth. When the summer sun hits our skin, our immediate instinct is that the heat itself is what burns us. However, sunlight is a complex spectrum of electromagnetic radiation, and our body’s sensory perception can easily trick us into a false sense of security.

1. The Illusion of the Cool Breeze

Sunburn is caused by UV radiation, not by the temperature of your skin. It is a radiation burn caused primarily by UVB radiation, with UVA also contributing to skin damage. UVB has a shorter wavelength and enough photon energy to break chemical bonds in cellular DNA. The resulting cellular damage triggers the inflammatory response we recognize as sunburn. In contrast, the sensation of warmth comes from infrared rays.

If you are swimming in a cool pool, feeling a chilly breeze, or using a cooling mist, your skin temperature remains low, but the UV radiation hits your skin cells at essentially the same rate. Neither pool water nor mist blocks UVB rays significantly. Water provides only modest protection near the surface. Significant UV reduction occurs only after substantial depth (roughly around a meter, depending on water clarity). Because cooling masks the sensation of heat, it often leads to a more severe burn by tricking you into staying outdoors far longer.

This is why people often get badly sunburned while skiing or mountaineering, despite air temperatures below freezing. At high altitudes, the thinner atmosphere absorbs less UV radiation, and snow can reflect up to 80% of incoming UV, substantially increasing exposure.

2. The Vitamin D Synthesis Balance

Despite the risks of radiation, solar exposure is vital for human health. UVB radiation is the sole trigger for synthesizing Vitamin D. When UVB photons hit the epidermis, they split a chemical bond in a compound naturally present in your skin (7-dehydrocholesterol), instantly converting it into Vitamin D3. 

Because standard window glass blocks 99% of UVB, you cannot produce Vitamin D by sitting next to a closed window, despite how bright or warm it feels. Your skin requires direct, unhindered exposure to the sun. 

Fortunately, it doesn't take much: In summer around mid-latitudes, exposing your arms and legs to midday sun for just 10 to 15 minutes a few times a week is often enough for Vitamin D synthesis, maximizing metabolic benefits while keeping cellular DNA damage low.

3. The Biological Trade-off: Pigment and Heat

Darker skin contains a high concentration of eumelanin, a dark pigment that acts as a built-in physical shield. Eumelanin absorbs and scatters UV radiation, offering a natural protection factor equivalent to roughly SPF 13–15. However, basic physics dictates that darker surfaces have a lower albedo (reflectivity) and absorb more light across the visible and infrared spectrum. 

Because darker skin absorbs more visible light, it can reach somewhat higher surface temperatures under strong sunlight. However, this difference is moderated by increased blood flow, sweating, and other thermoregulatory mechanisms, keeping core body temperature essentially unchanged. This likely reflects an evolutionary trade-off in which protection against UV-induced DNA damage outweighed the modest increase in cooling requirements.

Thursday, June 11, 2026

Why Flying is Safer Than Driving: The "Amateur Variable"

When travelling by air, the most dangerous part of your journey is the drive to the airport. Your annual odds of dying in a car crash are roughly 1 in 8,500, compared to 1 in 11 million for a commercial flight. Since we travel infrequently by air, a better risk comparison is to use per mile risk, where cars are 519 times more dangerous than planes.

While aerospace engineering, regulations and air traffic control deserve a lot of credit, the underlying secret to aviation safety comes down to a fundamental human truth: the total elimination of the amateur operator.

The barrier to entry for an automobile driver’s license is low. You pass a basic test in your youth, and for the next several decades, you are rarely, if ever, re-tested.

When you slide onto the highway, you are operating in a chaotic, tight, two-dimensional space. You are sharing the asphalt with drivers who might be fatigued, distracted by a text message, impaired by alcohol, or simply having a bad day. On the road, your safety depends heavily on the unpredictable decisions of amateurs.

An airline cockpit is a zero-amateur environment. To sit in that seat, a pilot must log hundreds of hours of initial training, pass rigid medical screenings, and clear random drug tests. More importantly, their education never stops. Every six months, commercial pilots are forced back into high-fidelity simulators to be tested on the absolute worst-case scenarios: engine blowouts, severe turbulence, and system failures.

Furthermore, aviation operates under strict Crew Resource Management protocols. There is no room for ego or unmonitored human error; every action is checked and cross-checked by a qualified co-pilot, backed by an automated system of digital guardrails. If a driver falls asleep at the wheel, the car becomes a missile. If a pilot faces a medical emergency, a second, equally trained professional instantly takes the controls.

Odds of Dying


8,500  ≈ 340,000,000 / 40,000

Saturday, June 06, 2026

The Joy of Historical Deep-Dives with AI

My recent chat with AI started simple: How did we get from Michael Faraday’s 1821 toy demonstration of a wire spinning in a bowl of mercury to the high-power industrial motors that run our world today?

It turns out the evolution of the electric motor wasn't just a story of laboratory breakthroughs. It was a messy, high-stakes saga funded by wartime telegraphy, secured by Cossacks, and built by a group of brilliant, broke brothers who knew exactly how to close a magnetic air gap when it mattered most.

When I asked what role Werner von Siemens played, the conversation shifted from pure physics to heavy mechanical engineering. It turns out Siemens’ grand contribution wasn't discovering a new law of nature; it was eliminating the air gap.

Early armatures were bulky and left air gaps between the spinning rotor and stationary magnets. Because air resists magnetic fields, energy was wasted. Siemens invented the shuttle armature in 1856, cutting deep grooves into an iron cylinder to tuck the wires inside, allowing the iron core to spin mere fractions of a millimeter from the magnets.

I realized that Siemens was pouring capital into motor R&D in the 1850s and 60s, but motors weren’t commercially viable yet. Where was the money coming from?

I discovered that Werner von Siemens started with absolutely zero family money. He was not a member of the aristocracy, Werner officially received the "von" name in 1888, quite late in his life (he was 71 years old). He was a penniless son (with 10 other siblings) of an educated tenant farmer who couldn't afford college. He only got an engineering education because he joined the Prussian Artillery Corps in 1834, which offered free schooling to officer candidates.

To be accepted as an officer candidate, Werner had to pass a demanding entrance examination that tested math, physics, geography, and French. This was a great hurdle for him because his secondary school education had focused heavily on classical languages (like Latin and Greek) rather than hard sciences. He spent three months cramming under intense self-preparation. Later in his life, he admitted in his recollections that while he prepared fiercely, passing the exam and securing his spot was also aided by "a spot of good luck."

Once inside the academy, Werner treated his strictly military duties as a necessary chore to secure his livelihood, focusing his real energy on the chemistry and physics lectures taught by top university scientists. The penniless outsider had successfully used the Prussian state to fund the very education that would later allow him to revolutionize the industrial world.

Even his early laboratory work was pure hustle. He perfected a commercial electroplating process while serving time in a military prison cell for acting as a second in an illegal duel! Because he was an officer, he was given "honorable confinement" (Festungshaft), allowing him to turn his cell table into a chemistry bench and smuggle in reagents through a friendly local apothecary and earn some money.

While serving as an artillery officer, Werner became fascinated by the early needle telegraphs being developed in Britain by William Fothergill Cooke and Charles Wheatstone. These early devices required users to watch multiple needles point to letters on a diamond-shaped grid. They were finicky, easily knocked out of sync, and required skilled operators. Werner looked at this system and thought he could make it vastly more user-friendly. In 1846, he built a prototype of a dial telegraph. It was so simple that an untrained person could type and read messages instantly.

Because Werner had spent years publishing scientific papers and developing his dial telegraph prototype, he was appointed as a technical expert to the Prussian Telegraph Commission in 1846. He effectively became the internal advisor helping the government decide what to buy, putting him in the perfect position to pitch his own capabilities.

Werner had the design, but he lacked two critical things: the money to build it at scale, and the mechanical precision to manufacture it perfectly. He found his solution in two men: Johann Georg Halske, a highly skilled master clockmaker and precision mechanic in Berlin. Johann Georg Siemens, Werner’s wealthy cousin. He provided the initial seed capital of 6,842 thalers (a substantial sum for a young startup) to buy tools and rent a small workshop. On October 1, 1847, they opened the Telegraphen-Bauanstalt von Siemens & Halske in a small Berlin courtyard with just ten employees.

In 1848, amidst a wave of violent democratic revolutions, the Prussian government desperately needed a secure, underground communications line from Berlin to Frankfurt. Werner did not have high-society aristocratic connections, but he built a highly strategic, merit-based professional network inside the Prussian military and scientific establishment. He secured the 1848 Berlin-to-Frankfurt 500km telegraph contract through a mix of institutional placement, a powerful mentor (Magnus), and a perfectly timed political crisis. He also had just invented a machine to coat copper wires in seamless gutta-percha (a newly discovered Malaysian tree sap, better than rubber, sent to him by his younger brother Wilhelm in London). He landed the contract and laid the underground line.

But then came the twist: After a while, the early underground wires rotted. Bacteria ate them. Field mice and hamsters chewed through them. The Prussian underground network collapsed, a bitter bureaucratic feud erupted, and Siemens was effectively blacklisted from getting any more Prussian state contracts.

To survive, the Siemens brothers had to pivot internationally. They ignored Germany and went all-in on the Russian Empire. It required adapting to a closed, highly suspicious St. Petersburg aristocracy. Werner sent his 24-year-old brother, Carl Siemens, to embed himself in Russian high society. Carl succeeded by exploiting the looming panic of the Crimean War and pitching a killer product: a telegraph dial entirely redesigned with the Cyrillic alphabet, meaning completely untrained Russian soldiers could operate it instantly. They first won the initial contract for a line from Warsaw to the Prussian border, finishing in months, proving to the Tsarist officials that the company could deliver under immense pressure. Then they won the 9,000km 1853 telegraph contract.

Having learned his lesson from the previous underground catastrophe, instead of burying the wires to rot, Siemens built a 9,000-kilometer overhead network on wooden poles. This led to the discovery of the Tatarengalvanometer.

Laboratory testing equipment of the 1850s used delicate silk threads to hang magnetic needles, they broke if you looked at them wrong. Because Siemens was laying lines through the brutal Siberian winter and the rocky Caucasus, Werner ruggedized the technology. He mounted the needle on a heavy steel pivot and encased it in a dust-proof, waterproof cast-iron shell. It was built so tough that local labor crews could drop it in the mud or throw it in the back of a horse wagon without losing calibration.

The engineers affectionately named it after the local frontier populations: the Tatarengalvanometer.

...And the rest is history.

If I had read a standard biography of Werner von Siemens, I would have gotten a dry list of dates. If I had read a textbook on electric motors, I would have gotten pure math.

By using an AI collaborator as an adaptive sounding board, I was able to follow the thread of my own curiosity in real-time. I could jump instantly from the electromagnetic flux of a shuttle armature to the sociological reasons a German engineer could charm his way into the Tsarist court, and then immediately back down to the math of Ohm's Law.

The Siemens story is also a reminder that extraordinary success requires hard work, resilience, intelligence, building a strong network by being useful to others, and a measure of luck, often arriving disguised as a crisis.

PDF: Memoirs of Siemens [Lebenserinnerungen] 

Music: Where have all the Flowers Gone - Marlene Dietrich

Sunday, December 28, 2025

Computer engineering magic

"Any sufficiently advanced technology is indistinguishable from magic." Arthur C. Clarke
In the field of computer engineering, the following appear as magic to me. I am planning to lift this mystery by building small-scale models:
  1. Detecting syntax errors while typing (linting)
  2. Code completion
  3. Deserializing JSON into a class instance
  4. Stopping a program at a breakpoint and inspecting debug information
  5. Interpreters (with parallelism on multicore) and compilers
  6. How Minecraft Seedcracker works
  7. How games like Prince of Persia could be written in assembly
These would help me to transition from "user of tools" to "creator of systems."

Sunday, November 16, 2025

Surprising Facts

A collection of facts that I found surprising:
  1. Availability of animals for domestication was the reason for deadly animal-human disease transmission and the death of 90% of American indigenous population. And the lack of domestic animals in the Americas was the reason why there was no American plague spreading in Europe.
  2. The Wright brothers did not invent flying in the general sense but they invented controlled flying by overcoming adverse yaw during rolling maneuvers.
  3. The root cause of the oxygen tank explosion in the Apollo 13 mission was using 60V during ground operations on 28V rated oxygen tank to boil off oxygen in the tank which led to welding of the thermostat and the eventual burning of wire Teflon coating.
  4. The Linux Kernel has thousands of goto statements.

Thursday, August 21, 2025

Germany-Switzerland Train Tour

This August we embarked on a train tour across Germany and Switzerland, visiting a different city every day. Our route was: Düsseldorf – Köln – Koblenz – Heidelberg – Freiburg – Luzern – Interlaken – Bern – Zürich – Stuttgart – back to Düsseldorf

We chose the cities so that each train journey was around one hour. Every afternoon, we traveled to a new city, rested at the hotel, took an evening walk, ate dinner, then the next morning had breakfast, checked out while leaving our baggage at the hotel, explored the city for a couple of hours, picked up our luggage, and continued on to the next city.

Booking Trains and Hotels

We had secured our train tickets and hotel bookings as early as April. It is not critical for train tickets because you will always find a train with paying around 20% more if you buy on the day of your journey. Buying individual tickets for each route was much cheaper than buying a Eurail Pass. Hotels must be booked in advance, otherwise you won't be able to find a room.

The entire process was digital. To buy train tickeds, we used DB Navigator, bahn.deOmio for Germany and SBB for Switzerland. You don’t need a physical ticket to board—just show the QR code to the ticket inspector after finding a seat. Seats usually display their reservation status on a small LCD screen next to them. If you don’t have a reservation, simply choose a seat that isn’t reserved.

We used Booking.com for hotel bookings, making sure our hotels were within 15 minutes walking distance of of train stations. We complemented our city explorations with walking routes from the GPSmyCity app (20 USD/year).

Trains

  • German ICE trains were fast, comfortable, with free WiFi and quiet 1st class cars.

  • Note that sometimes they change the train platform/track number ("Gleis" in German). Pay attention to the screens and announcements. In the photo below, the platform of our train has been changed from 5 to 4:

  • Swiss regional trains were slow and more scenic, but 2nd class trains typically lacked WiFi. Even station WiFi required SMS verification—which didn’t accept Turkish numbers. That left us dependent on hotel WiFi unless we wanted to pay roaming fees.

  • Trains generally ran within 10 minutes of their scheduled time.

  • Seat reservations cost 7 euros per person, but if you travel outside rush hours, they’re unnecessary, there are plenty of empty seats.

One of the trip’s strongest impressions was how deeply rail networks shape daily life in these countries. Every town is linked by trains running at 150 km/h or more. This creates not just convenience for travelers, but also massive employment opportunities for technicians, engineers, and operators who maintain and innovate these networks.

As the saying goes: "A developed country is not a place where the poor have cars. It's where the rich use public transportation." For a deeper dive into this idea, I recommend the YouTube channel Not Just Bikes.

Practical Travel Notes

  • We were always able to pay by credit card. Only once did my card not work in a grocery store, and I had to pay in cash. Having 200 euros in cash will be more than enough.

  • Breakfast: Hotel breakfasts average 20 euros per person. Since we had modest breakfast needs, we skipped them, preparing our own breakfast, using our own egg cooker. A nice side benefit was that we didn’t have to conform to the hotel’s breakfast hours and each member of our family could sleep as much as they wanted. Grocery chains like REWE, Lidl in Germany and Coop in Switzerland became our go-to spots. Here is our typical breakfast:

  • In Switzerland, our egg cooker required a Euro-to-Swiss (Type J) adapter because it had thick pins, while Swiss electrical outlets are designed for thin ones:

  • Tap water: Safe and free everywhere.

  • Weather: It was a pleasant 25 °C on August 4, but by August 11 a heat wave had reached Germany and Switzerland, with temperatures rising to 35 °C, making walking exhausting. It lasted for a week and subsided just as we returned. Locals said this happens only once a year, and we were a little unlucky to catch it.

Wednesday, August 20, 2025

The Teenage Attention Crisis

A friend of mine asked me for advice on how to help his 17-year-old son overcome his gaming and video addiction. Short-form social media videos and online games are designed to be addictive. Having been a former StarCraft addict and now the father of a 13-year-old boy, I know firsthand that nothing compares to the thrill of online gaming.

The problem is, these activities don’t just eat up time — they erode attention span. Games and TikTok-style videos constantly reward the brain with quick hits of dopamine. You get instant excitement, instant novelty, instant feedback. Over time, this rewires the brain to expect stimulation every few seconds.

It is not an issue when the child is less than 7 years old and a tablet is a parent's best friend. As the child starts school, it makes it difficult to sit through a class, read a book, or even watch a movie without reaching for a phone. The mind starts craving constant action. Anything slower feels boring, even if it’s meaningful.

This is why expecting teenagers to “just stop” is unrealistic. No matter how fun or beneficial the alternatives may be, those alternatives can’t compete with the rapid-fire dopamine loops of gaming and social media.

And here’s the key point: it’s not about a lack of awareness. Teens know they should be studying, playing sports, or sleeping earlier. The issue is willpower — and when your brain has been trained to chase fast rewards, willpower alone isn’t enough.

So talking them into it rarely works, and even then only for a few days at most. The only reliable way is to restrict access: put the phone away, turn off the computer. Of course, they will get bored. But boredom is valuable because it pushes you to be creative, to explore, to come up with something new. If the phone is always there to fill every empty moment, the brain never learns how to generate its own entertainment or ideas.

For parents, holding the line is hard because kids will push back, they’ll get angry, and they’ll try to negotiate their way around the rules. We use Google Family Link to limit his mobile phone time and app access. During school semester, he’s allowed to use his computer only on weekends, for up to three hours per day. When he breaks the rules by secretly giving himself more time on his mother’s phone or by exceeding the three-hour computer limit, we take away his phone and computer for a couple of days. Before and during exam weeks, he also goes on a digital detox, meaning the phone and computer are completely put away for 2 weeks.

Music: Stromae - Papaoutai

Friday, May 30, 2025

Liselere Giriş Sınavı (LGS) Hazırlığı

Oğlumuz Argun şu an 12.5 yaşında ve 6. sınıfta, LGS’ye hazırlanıyor. Keşke çocuklarımız sınav kaygısı yaşamadan, yetenek ve ilgilerine göre yönlendirilse, eğitim sistemi onları rahat bir yaşama taşıyacak şekilde desteklese. Ancak ortam ne yazık ki şu an buna uygun değil

Lise ve üniversite giriş sınavlarının olmadığı ülkelerin ayırd edici özellikleri:

  1. Ekonomi ve sosyal destek güçlü, işsizlik oranı düşük, asgari ücretle geçinmek mümkün
  2. Üniversite mezunu olanla olmayan arasındaki iş bulma imkanlarında ve ücretlerde uçurum yok
  3. Öğretmen ücretleri yüksek

İlk iki özellik üniversiteye girme baskısını azaltıyor, üçüncüsü de eğitimin ve verilen notların kalitesini arttırıp merkezi sınava ihtiyaç duymadan öğrenci seçmeyi mümkün kılıyor. Bizim içinde bulunduğumuz ortamda bunlar istenen seviyede olmadığından çocuklarımızın sınavlarda başarılı olmasını istemek doğal. Elbette başarıya giden başka seçenekler de var; ancak ne yapılması gerektiğinin en belirgin olduğu yol sınavlardan geçiyor. Diğer seçenekler ise daha fazla çaba ve risk içeriyor. Çocuğunuz kendi başına çalışamıyor ve desteğe ihtiyaç duyuyorsa bu yazıda özetlediğim 5.5 yıllık deneyim işinize yarayabilir.

Eğitim hep özel ilgili alanlarımdan biriydi, ayrıca eşim de fen bilgisi öğretmeni. Argun'un doğmasıyla eğitim hobi olmanın ötesine geçti. Eğitim sisteminin çok sayıda sorunu olduğundan ve çocuğu en iyi velisi tanıyabileceğinden eğitim (terbiye, disiplin) ve öğretimin (matematik, İngilizce) ana sorumluluğu biz velilerde.

Argun'un okulda rahat edebilmesi için anaokulunda bir yıl fazladan kalarak ilkokula geç başlamasını sağladık. "Ya sıkılırsa" sorusuna yanıtımız "geride kalma hissi yaşamasındansa sıkılmasını göze alıyoruz" oldu. 7 yaşındayken (ilkokul 1. sınıf) her gün düzenli olarak Khan Academy ile matematik çalışmaya başladık. Günde 15 dakika ek çalışmayla 4. sınıfın sonuna geldiğimizde 8. sınıf matematik konuları bitmişti. Khan Academy’yi Argun tek başına değil, bizim gözetimimizde kullandı. Her gün düzenli olarak çalışmak çoğu yetişkin için bile zorken çocuğun iradesi yetmiyor. 5. sınıfla birlikte LGS matematik test kitapları çözmeye başladı. Sosyalleşmesi hep birinci önceliğimizdi, ders için sadece bilgisayar oyun zamanından çalıyorduk.

Hedef olmadan sınava hazırlanmak çok zor çünkü ders çalışmaktan daha cazip pek çok şey var. Profesyonel basketbolcu, YouTuber, ya da fizikçi olmak ilk bakışta hedef gibi görülebilir, ancak bu alanlarda konforlu bir hayat sürebilmek için Ankara'nın en iyi basketbolcusu olmak ya da fizik olimpiyat takımına girebilmek gerekir. İstatistik gereği çocuğunuzun böyle bir yeteneğe sahip olma olasılığı milyonda bir. Çocukların bir mesleği hedef haline getirebilmesi için işini severek yapan birilerinden destek alınmalı. Argun hedefi olan bilgisayar mühendisliği için %1'lik dilime girmesi gerektiğini bildiğinden ders çalışmanın sıkıcılığını iradesiyle ve bizim de onu biraz ittirmemizle aşabiliyor.

Hedefi belirledikten sonra çocuğun sınırlı bir kapasitesi olduğundan kapasiteyi idareli kullanmak lazım, yoksa çocuğun canından bezme riski var. Ek çalışmada tüm dersler yerine matematik ve İngilizce'ye odaklanmak en yüksek faydayı sağlıyor. Diğer derslere okulun istediği kadar çalışması yeterli oluyor.

Süreç boyunca sonucun değil gayretin, çözülen soru sayısının ya da harcanan vaktin değil, kapasitesini her seferinde biraz aşmasının gelişim için önemli olduğunu vurguladık.  Örneğin yorgunken 1 soru çözmek bile yeterli olabilir, iyi hissederken 10 soru bile az gelebilir. Kendini kandırmanın ne kadar kolay olabileceğini örnekledik. Argun büyüdükçe bunları daha iyi anlar hale geldi.

Durum değerlendirmesi için okulunun dahil olduğu Sebit SDS (Süreç Değerlendirme Sınavı) sonuçlarına odaklandık. 5. sınıftan başlayarak her dönem üç, yılda toplam 6 sınav yapılıyor, sınavlara farklı okullardan yaklaşık 3000 öğrenci katılıyor. Argun 5. sınıfta pek de iyi olmayan bir başlangıcın ardından inişli çıkışlı bir performansla 6. sınıfı güzel bir yüzdelik dilimde bitirdi:

Sınavlarda Argun'un fire vermesinin sebebi konu eksiğinden ziyade konsantrasyon süresinin kısalığıydı. Son sınav öncesinde kendisinin de rızasıyla bir ay dijital detox uyguladık, kitap okuma süresini arttırdık. İşin ciddiyetinin farkına vardı ve sınava konsantre girdi. Bundan sonrası aynı yöntemi uygulayıp seviyeyi korumak.

Thursday, May 15, 2025

Intersection of circle and sine wave

I recently encountered the following question [University of Tor Vergata, Engineering Sciences, PreCalculus self assessment test, Geometry D]: A circle has center at the point A = (1, 1) and has radius r = 2. At how many points does it intersect the function y = sin(x)?

The equation of the circle with center (1, 1) and radius 2 is: (x - 1)² + (y - 1)² = 4

At any intersection point, the coordinates (x, y) must satisfy both equations:

1. (x - 1)² + (y - 1)² = 4

2. y = sin(x)

Let's substitute the second equation into the first: (x - 1)² + (sin(x) - 1)² = 4

This is a transcendental equation and cannot be solved analytically. Luckily, the equations are easy to plot by hand. The circle is trivial and plotting sin(x) only requires you to know that sin(0)=0, sin(pi/2)=1, sin(2*pi)=0. The sine wave amplitude is between -1 and 1. Since the circle has radius 2 and is centered at (1, 1), both the x and y interval for the circle will be [-1, 3]. This results in two intersections. Using Desmos for a cleaner plot:

Note that if we increase the amplitude of the sine wave, we will can have more than 2 intersections. For an amplitude of 3.5, we have 4 intersections:

After amplitude, if we also increase the frequency by 4, we get even more intersections:
It is only reasonable to find the number of intersections by hand drawing if the sine wave is of the simple form sin(x).

If you want to find the numerical values of the intersections (which is not asked for in the question), you have to use numerical root finding methods like Newton-Raphson.

Tuesday, February 18, 2025

Learning from failures

Failures present valuable opportunities for learning only when there is no blaming or shaming of individuals. What may initially appear to be a foolish oversight often reveals systemic issues. A common cause is placing inexperienced personnel under unrealistic time pressures—neither of which can be resolved in the short term. This can lead decision-makers to treat complex systems as if they were linear or simplistic, ignoring interconnected factors and feedback loops [The Logic Of Failure]. People often focus on immediate outcomes without considering long-term or indirect effects, resulting in burnout, stress, and demotivation [Death March].

If failures were treated as insights that help uncover the mysteries of the physical world, they might even become occasions for celebration—because each failure reveals something new. They could be thoroughly analyzed and shared widely so that everyone benefits. Of course, this requires a reality-based culture of critical thinking, rather than a rush to find someone to blame—whether to feel good about ourselves or crush our rivals—until the next mishap. The road to most engineering catastrophes is paved with cover-ups of smaller mistakes.

The best examples of failure analysis come from the aviation industry, where even seemingly outrageous mistakes [Aeroflot Flight 593, Pakistan Airlines 8303] are traced back to systemic root causes like problematic hiring processes and insufficient training.

Music: Adelita (classical guitar)

Saturday, February 15, 2025

Hexagon proofs

Yesterday, I was solving a math problem with my 13 year old son involving a hexagon. The sum of internal angles of an n-sided polygon is calculated by the formula (n-2)*180°. For a hexagon, the number of sides n=6, the sum is (6-2)*180°=720°. I didn't like to use this formula and thought about a proof: Let's draw four triangles inside the hexagon and label the angles:
The 6 interior angles of the hexagon would be:
  1. a1+a2+a3+a4
  2. b1
  3. c1+b2
  4. c2+b3
  5. c3+b4
  6. c4
We know that the internal angles of a triangle, e.g. a1+b1+c1 is 180°. If we sum all the 6 internal angles of the hexagon, we see that they are equal to the sum of the internal angles of our 4 triangles. Therefore, the sum of the internal angles of a hexagon is 4*180°=720°.

Then I wanted to prove that the 6 triangles created by the diagonals of a regular hexagon are equilateral:

We can label the triangle internal angles x, y, z as follows:
 Using parallel lines, we can fill the internal angles of all 6 triangles:

Note that the sum of internal angles of the hexagon are (z+x)+(y+z)+(x+y)+(z+x)+(y+z)+(x+y) = 4*(x+y+z). Since x+y+z=180°, this is another way to prove that the sum of internal angles are 4*180° = 720°. Also note that this proof is only valid for a regular hexagon. For a non regular hexagon, the sides would not be parallel and we would not be able to assert the equality of angles of triangles. The first proof at the top is valid even for a non-regular hexagon.

Since all triangles have the same 3 internal angles (x, y, z), they are similar. Since they also have a side of length "a", they must be congruent. Since the side "a" is opposite to angle x in one triangle and opposite to y and z angles in the others, the angles must be the same, x = y = z, which can only happen if they are all 60°. Therefore, the triangles must be equilateral:

Sunday, November 03, 2024

Career advice for students

Yesterday, we had a meeting organized by ODTÜ KAF, where graduates and students came together to share experiences. We had interesting conversations, focusing on questions like, "I face many difficulties getting an interview, what can I do to increase my chances? How should I present myself in an interview?"
First, expand your network, as it largely determines the opportunities you receive. Attend/organize events like the one yesterday. Look for ways to be useful by volunteering for work you enjoy or can at least tolerate. For example, I teach robotics to kids for free. Since I like engineering and helping others, it's manageable for me, and it allows me to be part of a community. Create online content to make it easier for others to discover you. No one is immune to peer pressure, pick good peers. Be patient; it may take more than a year to see any results.

On the self-development front, strive to be a rational, decent human being who lives in reality, not in the fantasy we are all susceptible to creating for ourselves. Some helpful books are Thinking Fast and Slow, Getting Things Done, and The 7 Habits of Highly Effective People. For more books, click here. In your university courses, get good grades, aim for a CGPA of at least 3 out of 4 (75%).

While looking for a job, focus on jobs related to your field of study, not so much on your dreams. For example, if you're studying food engineering, don’t try to break into digital marketing or software engineering, as the competition there can be overwhelming for you. Once you’ve established a strong foothold in your field, you can try branching out into other areas. Remember that the position you start in is not your destiny; I have made dramatic career changes three times while staying at the same institution for the past 28 years, transitioning from mechanical engineer to simulation engineer to software engineer.

Don't just blindly send CVs, use LinkedIn to directly message people working in companies you're interested in. Ask them about the company and how you could contribute. Seek advice on improving your chances of securing an interview and being accepted. Inquire about the approximate salary range for the position you're targeting. Most people will respond positively. Since LinkedIn shows whether any of your contacts are connected to the people you want to reach, you can ask your contact for an introduction or message them on your behalf. Work on personal projects that are aligned with those companies and share your progress on social media to increase your chance of getting noticed because it is an effective way to show your interest and capabilities in the field and your presentation skills.

During the interview, avoid saying mundane things like "I like to learn" or "I am a team player". Emphasize that your goal is to create as much value as possible for the people around you and the company, and provide examples (by citing examples from your LinkedIn research) of how you could achieve that.

When you get a job, ask yourself, "How can I create maximum value for the people I interact with?" You can even ask them this question directly; they'll likely appreciate your initiative. These individuals will become your internal network, whose support is crucial. Of course, they need to be people you respect, as your quality of life depends more on them than on the company as a whole. Don’t obsess over what others earn; focus on how you can become more effective in your job. If after a few months, you realize that you dislike the job or don't respect the team, seek advice from an experienced mentor, like me. If your mentor agrees that the problem is not you but the job/team, consider alternatives such as transferring to another department or company.

After I explained how I assist students with their studies, help them find internships and jobs, and provide guidance throughout their careers, I was asked why I help others. I've always been fortunate in many respects, such as having a loving family and living in a relatively stable part of the world. I feel indebted, want to give back, and create value. I already have a comfortable life and don’t need many material possessions. Much of life's meaning lies in helping others navigate this complex world and reducing suffering when it's within my power to do so with little effort.

Thursday, July 18, 2024

Üniversite mi, bölüm mü

2024 YKS üniversite tercihleri ile ilgili son günlerde izlediğim iki videoda "seçim yaparken üniversitenin kalitesi bölümden çok daha önemli" vurgusu yapılınca (video 1, video 2) 27 yıllık mühendis olarak bu yazıyı yazma ihtiyacı hissettim. Bölümden ziyade üniversiteye önem vermenin artılarından bahseden çok da eksilerden bahseden yok.

İyi üniversitelerin en çok vurgulanan faydaları öğrenci kulüplerinin fazla olması, etkileşimde bulunacağın insanların kalitesi ve üniversite networkünden yararlanmak. Burada söylenmeyen husus mezun olduktan sonra kendi okuduğun bölümün dışındaki öğrencilerin profesyonel anlamda sana pek bir faydasının dokunmayacağı. Örneğin Hacettepe öğretmenlikte okurken toplulularda mühendislik ve tıp öğrencileri ile arkadaşlık edebilirsin ama mezun olduktan sonra onların sana iş konusunda destek vermeleri ne kadar mümkün? Bölümden arkadaşların ise staj ve iş bulmana yardım edebilirler, iş yaşamın boyunca onlara danışmaya devam edebilirsin.

Bu arada mühendislik okurken topluluklarda vakit geçirme imkanın az, ben üniversitenin tadını mezun olduktan sonra çıkarabildim, okurken bahar şenlikleri uzaktan duyduğum hoş bir sada idi.

Aileler üniversite adının prestijini kullanmayı seviyor, genelde "bizim çocuk ODTÜ'de okuyor" denir, bölümden bahsedilmez pek. Öğrenci de üniversite sınav badiresini atlattıktan sonra bu itibardan yararlanmak ister. Ama aynı aileler mezuniyet sonrası çocuklarının iyi bir işte çalışmasını daha çok ister. 

Klasik öğrenci hayalleri: "kötü bölüme girsem bile kendimi geliştiririm, yazılım öğrenirim, yüksek ortalama tutturup daha iyi bir bölüme yatay geçiş yaparım, çift anadal yaparım." Bunları başarma olasılığın çok düşük. Bir yıl daha sınava hazırlanmaya mecalin varsa ve "mezuna kalır ve başarı sıralamamı ciddi oranda iyileştiririm" diyebiliyorsan şansın daha fazla.

Geleceği parlak bölümlerin sayısı az. İyi üniversite hevesi ile önü kapalı bir bölümü seçersen pek çok işe başvurman bile mümkün olmaz. İş ilanlarında üniversite adının yazıldığını ben hiç görmedim ama istenen bölümler mutlaka belirtilir.

Örneğin 25K sayısal başarı sıralaması ile Ankara'da devlet okulunda mühendislik istiyorsan ODTÜ Petrol Müh., Hacettepe Kimya Müh. veya Gazi Bilgisayara girebilirsin. Eğer aslolan üniversitedir diyeceksek ODTÜ Petrol'ü yazman gerekir. Bilgisayardan mezun olduğundaki seçenek bolluğu ile petrol veya kimya mühendisliğinden mezun olduğundaki seçenek darlığını dikkate almanı öneririm.

Kritik soru şu: Önündeki 4 yılı mı optimize etmek istersin, 40 yılı mı? Tavsiyem üniversite gözetmeksizin başarı sıralamana uygun bilgisayar mühendisliği bölümlerini yazmandır, nedenlerini daha önceki bir yazımda açıkladım.

Friday, March 29, 2024

Matematik'te ezber yerine mantık yürütme

Dün oğlum 8. Sınıf Master Matematik Soru Bankası'ndaki Ünite Değerlendirme-5, soru 7'nin çözümünü tam anlamadığı için bana sordu:

Sorunun cevap videosunda üçüncü kart olarak BC=16cm çıkması durumunda birden fazla üçgen oluşturulabileceğini, bu nedenle olasılığın 3/4 olduğunu söylüyordu. Birden fazla üçgen oluşması için öne sürülen argüman tek üçgen için bir açı ve iki komşu kenarının bilinmesi gerektiği, eğer açının (soruda C açısı) karşısındaki kenar (16cm) verilirse tek üçgen belirtmeyeceği idi.

Oğluma soruları mümkün olduğunca kural ezberleyerek değil, mantık yürüterek çözmemiz gerektiğini hatırlattım ve şu yolu izledim:

  1. A merkezli ve 16cm yarıçaplı bir çember çizersek bu çember C'den geçen ışını iki noktada (B ve D) keser.
  2. 16cm AC'den (14cm) fazla olduğundan ikinci kesişim C köşesinin üst kısmında kalır (D noktası).
  3. Sorudaki üçgenin oluşabilmesi için çember kesişimi C'nin altında olmalıdır (B). O da ancak bir nokta olabileceğinden üçüncü kartın BC=16cm çıkması durumunda dahi tek üçgen oluşur.
  4. Cevap çözüm videosundaki 3/4 seçeneği değil, 4/4 = 1 seçeneği olmalıdır.

AB verildiğinde C noktasının altında iki kesişim, yani iki üçgen olasılığı ancak AB'nin AC'den az ve BC kenarına ait yükseklikten (h) fazla olması durumunda mümkün, bkz. aşağıdaki B1 ve B2 noktaları. AB uzunluğu yükseklikten de az olursa kesişim olmayacağından üçgen oluşmaz. AB yüksekliğe eşit olursa yine tek üçgen oluşur.

Tuesday, November 28, 2023

Kanban vs. Scrum

Kanban is highly flexible with no fixed timeframes. In Scrum, work effort has to be estimated and organized into fixed-length iterations, known as sprints, typically lasting 2-4 weeks.

Kanban is better for projects with changing priorities, while Scrum is more suited for projects with defined requirements and deliverables. If continuous delivery is essential, Kanban might be the better choice. For projects benefiting from iterative development, Scrum is preferable.
For the type of work I am doing, I prefer using the Kanban method, incorporating daily stand-up meetings where each person speaks for no more than 5 minutes. This ensures that everyone stays focused and that efforts are concentrated on high-priority issues.

Sunday, November 12, 2023

The Case Against Education

"The Case Against Education: Why the Education System Is a Waste of Time and Money" by Bryan Caplan argues that a significant portion of education is not about acquiring useful job skills, but rather about signaling to employers. Caplan suggests that much of education's value comes from the signal it sends about a student's intelligence, conscientiousness, and conformity, rather than from the skills and knowledge they acquire. He believes that this signaling explains why employers value degrees even in fields unrelated to the job. Caplan also argues that this focus on signaling leads to a waste of resources and time, as students are made to learn subjects that are not directly useful to their future careers. He suggests that a more efficient educational system would focus more on vocational training and less on traditional academic education. He dispels many arguments that are taken for granted by looking at actual numbers.

Monday, September 25, 2023

Outsourcing software development

When outsourcing parts of a software development project, you'll need to overcome several challenges:

Clearly Define the Problem and Verification: It's essential to have a detailed design and create prototypes for testing your ideas before writing a statement of work. The outsourcing partner mainly contributes in terms of usability and maintainability, i.e. they should convert the proof of concept that can barely be used by experts to a product that can easily be used by normal people.

Identify Reliable Partners: This is arguably the most challenging step. In the software world, many claim expertise – after all, it's just coding, right? However, the ideal scenario is knowing firsthand that the team or individuals you're considering are truly capable of handling the project. If you are not sure, starting with small scale (~1 week) discovery projects (free of charge) will be helpful.

Manage Budgetary Constraints: As costs rise, so does the bureaucracy and the number of required approvals. One effective way to control cost is to narrow the project's scope and build on top of open source. While it's imperative to obtain the source code from your partner, consider handling documentation, formal verification and maintenance internally.

By adhering to these guidelines, you maintain control over the project and its future maintenance. You also gain access to top-tier talent that might not otherwise join your team, all while potentially reducing costs compared to in-house development.

Friday, September 08, 2023

Cybersecurity

When deciding on the level of cybersecurity rules to enforce, there is always a tradeoff between security and cost (money and more importantly workplace efficiency). Since 100% cybersecurity is not possible, risk tolerance becomes important.

The first step of cybersecurity is identifying the threat: Are you trying to prevent middle school kids from gaining root access to your servers or do you have national security agencies in mind? Are you trying to prevent data leakage or data corruption? If you want to minimize leakage, is your data really worth the protection cost? People confuse value with secrecy. Something valuable does not make it automatically secret. Many things in life are valuable but not secret. In my experience, the real secrets are far less than what is commonly claimed. Classifying threats and security levels requires individuals who are both experts in security and are aware of its costs. Good luck finding them. Your typical security advisor has a vested interest in scaring you enough to sell you expensive products.

Risk averse managers lean on more and stricter rules. Managers become risk averse when the expected value of taking risks is low for them personally, i.e. when managers are punished when a risk is realized but not rewarded enough when the benefits of taking risks are reaped. In other words, when loyalty is more important than competency.

What is worse is that stricter rules may create the illusion of security (Security Theater) but can actually decrease it. For example, if you force employees to change their passwords every week, they will use more predictable passwords and even write them on Post-its and attach them to the side of their screens!

In such an environment, the cost of lower efficiency almost never comes up in management meetings and that cost is passed on to the lower level managers and engineers. If you are a software developer, your build times increase and sometimes fail. You have to spend a week to find out that the security software was blocking it, and inform the IT department to make an exception for your build. Since software is an ever changing field, you face such problems regularly. If there is a security breach, individuals are held responsible and the system is never questioned. In the long run, this causes longer shipping times, low quality, low morale and loss of personnel. In short, less security and less value to secure...

You have to make peace with the fact that a security breach will eventually happen, similar to earthquakes. What I propose is to use a minimal set of malware scanners and to focus on preventing data corruption by having good backup systems in place. Regulary check that you can build back your system from those backups so that a corruption will have minimal impact.

For more, see my previous posts.

Thursday, July 06, 2023

Filtering software product ideas

A typical response I get from people when they learn that I am a software developer is, "I have this app idea X, does it have potential? Would you be willing to implement it?" In software, any idea can have potential, so dismissing it outright is not logical. My default answer is, "That's a fine idea. If you write a concept of operation document detailing how the app will be used and why it would be useful, I promise that I will design and code your first version (MVP) for free," and I genuinely mean it.

This approach benefits me in three ways. Firstly, by refraining from saying 'no', I show respect for their ideas and creativity, thereby avoiding potential hurt feelings. Secondly, it allows me to focus on truly promising and well-thought-out projects, rather than getting bogged down in evaluating every idea that comes my way. Lastly, if an idea does prove to be good, I gain the opportunity to create value.

However, despite my promise to work for free, I rarely receive a concept of operation document. It's easy to have an idea but difficult to write it down. Also, when writing it down, they think more about it and usually realize that it wasn't as impressive as they initially thought.

Music: Damon Albarn - Sister Rust