-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
571 lines (533 loc) · 29.7 KB
/
index.html
File metadata and controls
571 lines (533 loc) · 29.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="author" content="Michelangelo Naim" />
<meta name="keywords" content="Michelangelo Naim, Deep Learning, Mathematics, Statistical Mechanics" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Official Homepage of Michelangelo Naim">
<link rel="shortcut icon" href="favicons/favicon.ico">
<link rel="apple-touch-icon" href="favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" href="favicons/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="favicons/favicon-32x32.png" sizes="32x32">
<title>Michelangelo Naim</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css">
<link rel="stylesheet" href="css/layouts/blog.css">
<link rel="stylesheet" href="content/onebillion/calculator.css">
<script type="text/javascript" src="processing.js"></script>
<script type="text/javascript" src="content/onebillion/calculator.js"></script>
<!-- Math part -->
<script src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
<script type="text/javascript" id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<!-- Adding external html -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- <script>
$(function(){
$("#trying").load("content/chess/chess.html");
});
</script> -->
</head>
<body>
<div id="mySidebar" class="sidebar">
<!-- <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">x</a> -->
<a onclick="closeNav()" href="#aboutme">
<i class="fas fa-house icon-color"></i> About me
</a>
<a onclick="closeNav()" href="#clementines">
<i class="fas fa-seedling icon-color"></i> Nature project: clementines
</a>
<a onclick="closeNav()" href="#pulse">
<i class="fas fa-music icon-color"></i> Pulse: audio streaming
</a>
<a onclick="closeNav()" href="#billionSeconds">
<i class="fas fa-clock icon-color"></i> Billion seconds calculator
</a>
<a onclick="closeNav()" href="#hwm">
<i class="fas fa-calculator icon-color"></i> Math conjecture: high-water marks
</a>
<a onclick="closeNav()" href="#riddle">
<i class="fas fa-bacteria icon-color"></i> Math riddle
</a>
<a onclick="closeNav()" href="#miceMaze" class="mobile-hidden">
<i class="fas fa-paw icon-color"></i> Mice maze game
</a>
<a onclick="closeNav()" href="#exercisesAI">
<i class="fas fa-brain icon-color"></i> AI: some exercises
</a>
<a onclick="closeNav()" href="#2048">
<i class="fas fa-puzzle-piece icon-color"></i> AI project: 2048
</a>
<a onclick="closeNav()" href="#chess">
<i class="fas fa-chess icon-color"></i> AI project: chess
</a>
<a onclick="closeNav()" href="#minesweeper">
<i class="fas fa-bomb icon-color"></i> AI project: minesweeper
</a>
<a onclick="closeNav()" href="#fantasyshares">
<i class="fas fa-futbol icon-color"></i> Fantasy shares
</a>
<a onclick="closeNav()" href="#poetry">
<i class="fas fa-paper-plane icon-color"></i> Poetry
</a>
<a onclick="closeNav()" href="#beliefs">
<i class="fas fa-lightbulb icon-color"></i> Beliefs
</a>
</div>
<div id="main">
<div class="navbar-content">
<button class="openbtn" onclick="openNav()"><i class="fas fa-bars" style="font-size: 0.8em;"></i> Table of contents</button>
</div>
</div>
<!-- Mobile overlay -->
<div id="mobileOverlay" class="mobile-overlay"></div>
<script>
function openNav() {
document.getElementById("mySidebar").style.width = "250px";
document.getElementById("main").style.display = "none";
// Mobile overlay functionality
if (window.innerWidth <= 768) {
document.getElementById("mobileOverlay").classList.add("active");
document.body.classList.add("sidebar-open");
}
}
function closeNav() {
document.getElementById("mySidebar").style.width = "0";
document.getElementById("main").style.display = "initial";
// Remove mobile overlay
document.getElementById("mobileOverlay").classList.remove("active");
document.body.classList.remove("sidebar-open");
setTimeout(function(){
history.replaceState({}, document.title, window.location.href.split('#')[0]);
}, 500);
}
document.onclick = function (e) {
const sidebar = document.getElementById('mySidebar');
const openBtn = document.querySelector('.openbtn');
const overlay = document.getElementById('mobileOverlay');
// Don't close if clicking on the sidebar itself or the open button
if (sidebar.contains(e.target) || openBtn.contains(e.target)) {
return;
}
// Close sidebar if it's open and click is outside (or on overlay)
if (sidebar.style.width === '250px') {
closeNav();
}
}
function isMobileDevice() {
var hasOrientation = typeof window.orientation !== "undefined";
var isSpecificMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
var isChromeEmulation = window.chrome && screen.width <= 768; // or any other threshold for "mobile" screen width
return hasOrientation || isSpecificMobile || isChromeEmulation;
}
window.onload = function() {
var hCanvas = document.getElementById("h_riddleCanvas");
var vCanvas = document.getElementById("v_riddleCanvas");
if(isMobileDevice()) {
// console.log("The device is mobile.");
hCanvas.style.display = "none";
vCanvas.style.display = "block";
// Hide mice maze section and its table of contents entry on mobile
var miceMazeSection = document.getElementById("miceMaze");
var miceMazeLink = document.querySelector('a[href="#miceMaze"]');
if (miceMazeSection) miceMazeSection.style.display = "none";
if (miceMazeLink) miceMazeLink.style.display = "none";
} else {
hCanvas.style.display = "block";
vCanvas.style.display = "none";
}
}
function toggleSolution() {
var solutionDiv = document.getElementById("solutionSection");
var toggleBtn = document.getElementById("toggleSolutionBtn");
if (solutionDiv.style.display === "none" || solutionDiv.style.display === "") {
solutionDiv.style.display = "block";
toggleBtn.textContent = "Hide Solution";
} else {
solutionDiv.style.display = "none";
toggleBtn.textContent = "Show Solution";
}
}
</script>
<div id="layout" class="pure-g">
<div class="content pure-u-1">
<!-- <div class="content pure-u-1 pure-u-md-3-4"> smaller -->
<div>
<!-- A wrapper for all the blog posts -->
<div class="posts" id="aboutme">
<!-- A single blog post -->
<section class="post">
<header class="post-header">
<img class="post-avatar" alt="" height="90" width="90" src="avatar.jpg">
<h2 class="post-title">Michelangelo Naim</h2>
</header>
<div class="post-description">
<div class="info-box">
<!-- <br> -->
<blockquote>
<p><q><i>I'm still learning.</i></q> (<a href="https://en.wikipedia.org/wiki/Michelangelo">Michelangelo</a>, age 87)</p>
</blockquote>
<p>
Email: michi [at] basis [dot] ai
</p>
<p>
<a class="btn btnpurple" href="content/CV_michelangelonaim.pdf" target="_blank">CV</a>
<a class="btn btngreen" href="https://scholar.google.com/citations?user=hCEneNIAAAAJ&hl=en" target="_blank">Scholar</a>
<a class="btn btnred" href="https://github.com/naiimic" target="_blank">Github</a>
<a class="btn btnblue" href="https://www.linkedin.com/in/michelangelonaim/" target="_blank">LinkedIn</a>
</p>
<p>
I am currently a Research Scientist II at <a href="https://www.basis.ai/">Basis</a>, where I specialize in the intersection of AI, physics and math. My work is focused on developing computational theories of intelligence, including reasoning, learning, and decision-making, while contributing to and maintaining open-source software.
<p>
Prior to this, I was an ICoN Postdoctoral Fellow at <a href="https://mcgovern.mit.edu">MIT</a>, working with <a href="https://www.metaconscious.org/author/guangyu-robert-yang/">Guangyu Robert Yang</a>, using AI to model the brain.
I completed my Ph.D. at the <a href="https://www.weizmann.ac.il/pages/">Weizmann Institute of Science</a> under the supervision of <a href="https://www.weizmann.ac.il/brain-sciences/labs/tsodyks/home">Misha Tsodyks</a>. During my Ph.D., I spent time at the <a href="https://www.ias.edu/">Institute for Advanced Study</a> and the <a href="https://www.kitp.ucsb.edu">Kavli Institute for Theoretical Physics</a>.
Before that, I obtained my Bachelor's and Master's degrees in Physics at <a href="https://www.uniroma1.it/en/pagina-strutturale/home">La Sapienza</a> under the supervision of <a href="https://en.wikipedia.org/wiki/Giorgio_Parisi">Giorgio Parisi</a> and <a href="https://people.sissa.it/~ale/">Alessandro Treves</a> (<a href="https://www.sissa.it/">SISSA</a>).
</p>
<p>
I am deeply committed to AI safety and its responsible advancement. I am particularly interested in the study of <a href="https://distill.pub/2018/building-blocks/">mechanistic interpretability</a> and <a href="https://arxiv.org/abs/1906.01820">inner alignment</a> in neural networks. I aim to make AI more understandable, believing that this will help us learn and grow faster.
</p>
<p>
<i>This website doesn't describe my current research, but it's related to things I thought about and would like to share.</i>
</p>
</div>
</div>
</section>
</div>
<div class="posts" id="clementines">
<h1 class="content-subhead">Nature project: clementines</h1>
<section class="post">
<img class="post-avatar" alt="" height="125" width="250" src="content/clementines/avatar.jpg">
<div class="post-description">
<p>
In Italy, during Christmas time, we play a game called <a href="https://en.wikipedia.org/wiki/Tombola_(game)">tombola</a> (similar to the game of bingo).
The player purchases cards based on a fixed cost decided at the start of the game. Each card contains 15 random numbers (between 1 and 90).
Whenever the dealer draws a number that is present on one or more of their cards, the player "covers" the corresponding number.
Usually numbers are covered with beans, chickpeas, lentils or other material available after Christmas dinners such as <b>clementine skin</b>.
The ultimate goal of the game is to make "tombola", that is, to be the first player to cover all the numbers on one of their cards.
</p>
<p>
In 2014, while playing tombola, I asked myself my first research question: "How many segments are in a clementine?".
Since that day, with the help of other people, I started collecting data for fun. In 2017, I had an excel sheet with <b>10898</b> different samples.
</p>
<p><img class="post-images" alt="" src="content/clementines/mandarini.png"></p>
</div>
</section>
</div>
<div class="posts" id="pulse">
<h1 class="content-subhead">Pulse: audio streaming</h1>
<section class="post">
<img class="post-avatar-left" alt="" height="140" width="140" src="content/pulse/pulse_logo_square.jpeg">
<div class="post-description">
<p>
My friend and I built <a href="https://473999.net/pulse">pulse</a> because we wanted to bring back the human element in music discovery. In an age where algorithms dictate what we listen to, I believe there's something special about sharing music directly with others.
</p>
<p>
The platform features real-time visualizations that react to the music being played, creating an immersive experience. Users can chat while listening, making it feel like you're in the same room sharing music with friends.
</p>
<p>
It's a simple way to share what you're listening to with others, creating a more personal and authentic music discovery experience.
</p>
<p>
Like my other projects, pulse started as a small experiment but quickly became something I'm passionate about - I hope you'll give it a try and share some music with me or your friends.
</p>
<p>
<a class="btn btndarkyellow" href="https://473999.net/pulse" target="_blank">Start streaming</a>
</p>
</div>
</section>
</div>
<div class="posts" id="billionSeconds">
<h1 class="content-subhead">Billion seconds calculator</h1>
<section class="post">
<div class="post-description">
<p>
Have you ever wondered when you'll be exactly 1 billion seconds old? One billion is a huge number - it takes about 31.7 years to reach this milestone!
</p>
<div class="calculator-container">
<div class="calculator-form">
<div class="form-group">
<label for="birthdate">Your birthdate:</label>
<input type="date" id="birthdate">
</div>
<div class="form-group">
<label for="birthtime">Time (optional):</label>
<input type="time" id="birthtime">
</div>
<div class="calc-buttons">
<button id="calculateBtn" onclick="calculateBillionSeconds()" class="btn btndarkyellow" disabled>Calculate</button>
<button id="resetBtn" class="btn-reset" title="Reset form"><i class="fas fa-redo-alt"></i></button>
</div>
</div>
<div id="result"></div>
</div>
</div>
</section>
</div>
<div class="posts" id = "hwm">
<h1 class="content-subhead">Math conjecture: High-water marks</h1>
<section class="post">
<div class="post-description">
<p>
While working on my Ph.D., I encountered an interesting problem related to the high-water marks. Given a sequence of values \({a_k}_{k=1}^n\),
the high-water marks are the values at which the running maximum increases.
For example, given a sequence \([3,5,7,8,8,5,7,9,2,5]\) with running maxima \([3,5,7,8,8,8,9,9,9]\),
the high-water marks are \([3,5,7,8,9]\).
For every sequence \(a_k\) there is a number of high-water marks \({N}_{a_k}\).
</p>
<p>
If now we consider a set \(\sigma\) of all permutations of \(n\) numbers \((1, \dots, n)\) what is the analytical expression for the distribution of the number of high-water marks \(N_{a\in \sigma}\)?
For example, if \(n=3\), the distribution vector is \((\frac{2}{3!},\frac{3}{3!},\frac{1}{3!})\).
</p>
<p>
To solve this problem, consider the cycle representation of a permutation (including the trivial one-element cycles).
We have a bijection of the symmetric group with itself that maps between numbers of cycles and numbers of high-water marks.
Thus the distribution of the number of high-water marks is the distribution of the number of cycles.
This is given by the <a href=" https://en.wikipedia.org/wiki/Stirling_numbers_of_the_first_kind">unsigned Stirling numbers of the first kind</a>,
which has a distribution
$$ P_{s} (k;n) = \frac{|s(n;k)|}{n!} \, , $$
where
$$\begin{cases}
s(n;1) = (n-1)! \\
s(n;n-1) = \frac{n(n-1)}{2} \\
s(n;n) = 1
\end{cases}$$
</p>
<p>
For the full proof (special thanks to <a href="https://staff.fnwi.uva.nl/j.zuiddam/">Jeroen Zuiddam</a>)
you can click <a href="content/highwatermarks/hwm.pdf">here</a>.
</p>
</div>
</section>
</div>
<div class="posts" id="riddle">
<h1 class="content-subhead">Math riddle</h1>
<section class="post">
<div class="post-description">
<p>
Imagine you have a bucket of water containing two distinct types of bacteria: A and B. You start with one bacterium of each type, A and B. Every time you introduce a particle of food into the bucket, one of the bacteria consumes it. The bacterium that eats the food reproduces, adding one more bacterium of its type to the population. If you were to drop 100 particles of food into the bucket, can you predict the distribution of the A-type bacteria? </p>
<p>
<b>Example:</b> Suppose the bucket contains 3 A-type bacteria and 2 B-type bacteria. If you drop a food particle and an A-type bacterium consumes it, the population changes to 4 A-type bacteria and 2 B-type bacteria. On the other hand, if a B-type bacterium eats the food, the population becomes 3 A-type and 3 B-type bacteria.
</p>
<p>
<canvas id="h_riddleCanvas" data-processing-sources="content/riddle/h_riddle/h_riddle.pde" style="display: none; pointer-events: none;"></canvas>
<canvas id="v_riddleCanvas" data-processing-sources="content/riddle/v_riddle/v_riddle.pde" style="display: none; pointer-events: none;"></canvas>
</p>
<p>
The simulation above is a hint and represents the outcome after 9 drops of food. It runs 1,000 times to generate a histogram that showcases the probability distribution of the number of A-type bacteria.
</p>
<p>
<a id="toggleSolutionBtn" class="btn btndarkyellow" href="javascript:void(0);" onclick="toggleSolution()">Show Solution</a>
</p>
<div class="solution" id="solutionSection" style="display: none;">
<p>
The captivating result of this riddle is that the distribution for the number of A-type bacteria after any number of food drops is <b>uniform</b>. This may sound counter-intuitive at first, but the reasoning can be understood as a balance of probabilities (<a href="content/riddle/riddle.pdf">complete solution</a>)!
</p>
</div>
</div>
</section>
</div>
<div class="posts" id="miceMaze">
<h1 class="content-subhead">Mice maze game</h1>
<section class="post">
<img class="post-avatar" alt="" height="125" width="250" src="content/maze/avatar.jpg">
<div class="post-description">
<p>
Mazes have been a staple of animal psychology for well over 100 years.
<a href="https://elifesciences.org/articles/66175">Rosenberg et al. (2021)</a> presented a new approach to the study of learning and decision-making in mice.
They give the animal access to a complex labyrinth and leave it undisturbed for a night while monitoring its movements.
The result is a rich data set that reveals new aspects of learning and the structure of exploratory behavior.
</p>
<p>
Inspired by this paper, I decided to build a simple game (using GameMaker Studio2) that allows you to experience the same labyrinth as the mice did.
</p>
<p>
<i><u>Instructions</u>: The goal of the game is to recover a treasure inside a maze and return to the starting room. The faster you go back, the higher the score.
Use the arrow keys to move the character.
</i>
</p>
<p>
<a class="btn btndarkyellow" href="content/maze/maze.html" target="_blank">PLAY!</a>
</p>
</div>
</section>
</div>
<div class="posts" id="exercisesAI">
<h1 class="content-subhead">AI: some exercises </h1>
<section class="post">
<img class="post-avatar-left" alt="" height="160" width="120" src="content/exercises/brain.jpg">
<div class="post-description">
<p>
Do you know how to code and you are passionate about AI? Did you try to play with it but lost motivation because "too hard"?
Would like to better understand what exactly it is about and be able to apply it in your own research?
Great, this post is for you!!
</p>
<p>
Here is a small set of exercises that will walk you through some of the basics of AI.
These exercises will help you better familiarize with PyTorch, fully connected networks (FC),
convolutional neural networks (CNN), graph neural networks (GNN), attention mechanism and reinforcement learning (RL).
</p>
<p>
<a class="btn btndarkyellow" href="https://github.com/naiimic/DeepLearningExercises" target="_blank">AI Exercises</a>
</p>
</div>
</section>
</div>
<div class="posts" id="2048">
<h1 class="content-subhead">AI project: 2048</h1>
<section class="post">
<div class="post-description">
<p>
<a href="https://en.wikipedia.org/wiki/2048_(video_game)">2048</a> is a game played on a plain 4x4 grid, with numbered tiles that slide when a player moves them using the four arrow keys.
Every turn, a new tile randomly appears in an empty spot on the board with a value of either 2 or 4.
Tiles slide as far as possible in the chosen direction until they are stopped by either another tile or the edge of the grid.
If two tiles of the same number collide while moving, they will merge into a tile with the total value of the two tiles that collided.
The resulting tile cannot merge with another tile again in the same move. The game is won when a tile with a value of 2048 appears on the board.
Players can continue beyond that to reach higher scores. When the player has no legal moves (there are no empty spaces and no adjacent tiles with the same value), the game ends.
</p>
<p>
The AI algorithm is an <a href="https://en.wikipedia.org/wiki/Evolutionary_algorithm">evolutionary algorithm</a>.
In 2048 you can get pretty far by just pressing random keys. Therefore, building an AI is much harder, since the difference between random movements and intelligence movements is very small.
With the help of an algorithm, the AI will construct future game states and pick the one that has a higher score.
The score is computed taking into account not only the highest number, but also adjacent blocks of the same number and having the highest number on the corner.
</p>
<p>
Now look at the AI as it learns :)
</p>
<p>
<canvas style="pointer-events: none;" data-processing-sources="content/game2048/game2048.pde"></canvas>
</p>
</div>
</section>
</div>
<div class="posts" id="chess">
<h1 class="content-subhead">AI project: Chess</h1>
<section class="post">
<img class="post-avatar-left" alt="" height="125" width="250" src="content/chess/avatar.jpg">
<div class="post-description">
<p>
AI has influenced the way in which chess games are played at the top level. In order to build a simple AI that can play chess
we are going to use an algorithm called <a href="https://en.wikipedia.org/wiki/Minimax">minimax</a>.
In this algorithm there are two players, player A that tries to reach the highest value possible (max),
while player B is trying to reach the lowest value possible (min).
</p>
<p><img class="post-images" alt="" src="content/chess/minimax_alg.jpg"></p>
<p>
Let's consider a tree (figure above) where players alternate in making moves. Assuming that player B is perfectly logical and
places the best move possible, then which move should you make first as player A? The trick is to work backward.
If player B was at each intersection on the bottom layer, which direction would they choose? For the bottom left intersection they would choose 10 as it is the lower of the two.
That means the A player should consider the value of that intersection to be 10. We do this for all the bottom intersections, then we look one layer up and
think if player A was at each of these intersections which action would they take. We repeat this procedure until finally we will be left with two choices: either go left (-10) or right (-7).
Therefore, to maximize their score, A should pick right!
</p>
<p>
Chess is just a big game of minimax. We can create a score giving value to all the pieces
(Pawn = 1, Knight = 3, Bishop = 3, Rook = 5, Queen = 9) and then adding all the white pieces and subtracting
all the black pieces. From white prespective, you are trying to reach a high schore, while black wants to reach
a low score. The AI needs to generate all the boards that are possible to reach from our current one within a certain
number of moves, then calculate the score and find the best possible move it can take.
</p>
<p>
<a class="btn btndarkyellow" href="content/chess/chess.html" target="_blank">Beat the AI</a>
</p>
</div>
</section>
</div>
<div class="posts" id="minesweeper">
<h1 class="content-subhead">AI project: Minesweeper</h1>
<section class="post">
<div class="post-description">
<p>
<a href="https://en.wikipedia.org/wiki/Minesweeper_(video_game)">Minesweeper</a> is a game where mines are scattered throughout a board, which is divided into cells.
Cells have three states: unopened, opened and flagged.
An unopened cell is blank and clickable, while an opened cell is exposed. Flagged cells are those marked by the player to indicate a potential mine location.
A player selects a cell to open it. If a player opens a mined cell, the game ends. Otherwise, the opened cell displays either a number, indicating the number of mines diagonally and / or adjacent to it,
or a blank tile, and all adjacent non-mined cells will automatically be opened.
</p>
<p>
The problem with minesweeper is that at "hard" is a game of luck. Even the best player can get stuck with a 50% of loosing.
This AI is not a neural network, rather some coding. First few moves are random, then it uses some logic:
</p>
<ol>
<li>
If a cell has the same amount of hidden squares around it as unflagged bombs remaining around it, then all the hidden cells are bombs.
</li>
<li>
If a cell has the same amount of flags around it as its number, then all the hidden cells are not bombs.
</li>
<li>
Using probability the AI is able to select cells that have a lower chance of being bombs. Let's deifine \(N_i\) as the number of bombs arrangements in which a bomb is placed on a cell \(i\),
and \(T\) as the total number of possible bomb arrangements in the remaining cells. Now we have that the probability of cell \(i\) to be a bomb is given by
$$ P_i = \frac{N_i}{T} \, . $$
</li>
</ol>
<p>
Now look at the AI as it plays. If the AI wins the number of bombs increases by 1 (with a limit of 25 bombs).
</p>
<p>
<canvas style="pointer-events: none;" data-processing-sources="content/minesweeper/minesweeper.pde"></canvas>
</p>
</div>
</section>
</div>
<div class="posts" id="fantasyshares">
<h1 class="content-subhead">Fantasy Shares</h1>
<section class="post">
<div class="post-description">
<p>Since Italy did not qualify for the World Cup 2022, I organized a simple game in order to follow the tournament having fun throughout all the 64 games.</p>
<p>The idea is pretty simple: each player has some credits that are used to buy "shares" of the different teams (1 share = 1 credit), without knowing which shares the other players own. Every time a team wins a match, it gets a certain number of points. These points are divided among the team shareholders, according to the number of shares they own.</p>
<p>To learn more about it and to see the results of the <b>109 players</b> that decided to play, you can click <a href="content/fantasyshares_game/fantasyshares_game.html">HERE</a> .</p>
<p><img class="post-images" alt="" src="content/fantasyshares_game/trophy.png"></p>
</div>
</section>
</div>
<div class="posts" id="poetry">
<h1 class="content-subhead">Poetry</h1>
<section class="post">
<div class="post-description">
<p>
Sometimes, I love to read and write poetry. Here are a few I would like to share:
</p>
<ol>
<li>
<p><a href="content/poetry/ani_rotze_tamid_enayim.pdf">I always want eyes</a> (in hebrew) - December 2019</p>
</li>
<li>
<p><a href="content/poetry/at_israel.pdf">You, Israel</a> (in hebrew) - May 2020</p>
</li>
<li>
<p><a href="content/poetry/estate.pdf">Estate</a> (in italian) / <a href="content/poetry/summer.pdf">Summer</a> (in english) - July 2022</p>
</li>
<li>
<p><a href="content/poetry/albero.pdf">Albero</a> (in italian) / <a href="content/poetry/tree.pdf">Tree</a> (in english) - May 2023</p>
</li>
</ol>
</div>
</section>
</div>
<div class="posts" id="beliefs">
<h1 class="content-subhead">Beliefs</h1>
<section class="post">
<div class="post-description">
<p>I believe in the axioms by <a href="https://en.wikipedia.org/wiki/Federico_Ardila" target="_blank">Federico Ardila</a>:</p>
<ul>
<li>
<p><b>Axiom 1.</b> Mathematical talent is distributed equally among different groups, irrespective of geographic, demographic, and economic boundaries.</p>
</li>
<li>
<p><b>Axiom 2.</b> Everyone can have joyful, meaningful, and empowering mathematical experiences.</p>
</li>
<li>
<p><b>Axiom 3.</b> Mathematics is a powerful, malleable tool that can be shaped and used differently by various communities to serve their needs.</p>
</li>
<li>
<p><b>Axiom 4.</b> Every student deserves to be treated with dignity and respect.</p>
</li>
</ul>
</div>
</section>
</div>
</div>
</div>
</div>
<!-- <script data-name="BMC-Widget" data-cfasync="false" src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js" data-id="mnaim" data-description="Support me on Buy me a coffee!" data-message="" data-color="#5F7FFF" data-position="Right" data-x_margin="18" data-y_margin="18"></script> -->
</body>
</html>