KakkoKari (仮) Another (data) science blog. By Alessandro Morita

The math behind adjoints: PDE-constrained optimization for design

This article introduces PDE-constrained optimization, a discipline with deep applications in engineering design. After all, any physical law is represented by a PDE, and engineering cares a lot about finding optimal designs – lower costs, higher safety, better performance, you name it. We will navigate from good old Lagrange multipliers in $\ma... Read more

Infinite children? A nice problem in probability theory

Consider the following problem: A couple decides to have a male child no matter what. If their first child is a son, they stop; if it is a daughter, they continue having more children. There is no upper limit on how many daughters they can have before having a son. What is the average number of sons and daughters they will have? I was once ask... Read more

The interaction between heat and elasticity

When subject to an increase in temperature, a solid object will usually expand, and this expansion will act to increase internal stresses. In this way, variations in temperature affect solids’ mechanical properties. On the other hand, inside a solid body, heat transfer occurs mostly by diffusion from hot to colder zones. This depends not only o... Read more

Reinventing the wheel: simulating collisions

I am not a game designer; I have never used any engines such as Unity, nor have I done any 3D modeling before. Buuuuut…. I really like simulating physical systems. In my opinion, most Physics undergraduate curricula lack one thing in common: more emphasis on numerical simulations, be it solving the relevant differential equations (e.g. electrom... Read more

Attention: a tale of three spaces

I admit I always had some trouble understanding Attention in the context of Transformers. There are several good references for this - Jay Alammar’s The Illustrated Transformer is a common example. Still, I always had some difficulties building a mental model of what the attention mechanism does. Some references explain very thoroughly how to m... Read more