Optimal Blackjack Strategy Through Dynamic Programming

Blackjack Blackjack, also known as 21, is a casino banking game where players compete against the dealer rather than each other. The standard version uses one or more 52-card decks, where cards 2-10 count at face value, face cards (J, Q, K) count as 10, and Aces count as either 1 or 11. The game’s mathematical structure makes it particularly amenable to algorithmic analysis. Core Game Rules Objective: Achieve a hand total closer to 21 than the dealer without exceeding it Player Actions: Hit: Take another card Stand: Keep the current hand Dealer Constraints: Must hit until reaching 17 or higher Special Cases: Aces count flexibly as 1 or 11 “Blackjack” (Ace + 10-value card) pays 3:2 Dealer wins ties except when player has blackjack Dealer Probability Analysis The solution calculates exact probabilities for all possible dealer outcomes (17-21 or bust) given their initial card, using dynamic programming with memoization. The infinite deck assumption simplifies probability calculations since card draws remain independent. ...

August 4, 2025 · 11 min · Elvin Zeynalli

Learning Optimal Pricing with Reinforcement Learning

Project description Language: Python Working file: Jupyter Notebook Project type: Reinforcement Learning Problem Statement Dynamic pricing is a fundamental problem in economics and operations research. Sellers repeatedly interact with customers whose willingness-to-pay is uncertain. Each round: The seller offers a price from a feasible set (1–100). The customer either accepts or rejects. The seller observes only binary feedback (buy/no-buy). In our environment: Segment Valuation Market share 1 18 0.4 2 43 0.3 3 56 0.2 4 81 0.1 The theoretical optimal price is 43, yielding the maximum expected revenue given the mixture of valuations and probabilities. ...

May 20, 2025 · 5 min · Elvin Zeynalli

Analysis of State Schools in Scotland: Map of Scotland with Schools

Project description Language: Python, HTML Libraries: folium, pandas, numpy, requests, json IDE: Microsoft Visual Studio Code, Jupyter Notebook Project type: Data analytics, Web scraping, Map formation, API Keywords: Scotland, schools, deprivation, map Photo by ali elliott on Unsplash Postcodes API The available contact information for the schools solely consists of their postcodes and seedcodes. Consequently, in order to accurately locate each school on a map, I required latitude and longitude values for each establishment. In my search for geolocation information, I discovered an open platform called Postcodes IO. This platform offers a free API that allows access to the server and retrieval of geolocation information for every UK postcode. The collected data was presented in a JSON format. To obtain a comprehensive dataset from postcodes.io, I utilized various endpoints of the API, including the following: ...

October 9, 2023 · 8 min · Elvin Zeynalli

Building a Web Crawler using Python

In this article, I’m going to explain the concept of a web crawler, how search engines work, and guide you in building a simple Crawler bot. All the code I’ve written for this can be found on my GitHub repository, and feel free to use, modify, or replicate it for personal or commercial purposes without needing my consent. Project description Language: Python Libraries: request, bs4, regex, os, json IDE: Microsoft Visual Studio Code Project type: Web crawling/scraping Photo by Timothy Dykes on Unsplash ...

October 1, 2023 · 11 min · Elvin Zeynalli

Web Analytics: Analyzing clickstream of 160,000 visitors

Project description Language: Python Working file: Microsoft Visual Studio Code Project type: Web Analytics Companies receive traffic to their website from various resources. The more a company learns about the visitors’ traffic to its website, the better it understands the reasons behind their travel to the website. Besides the number of visitors to a website, it is important to learn from which sources those people arrive at the website. This can help the firms to see which external social account or network campaign is prone to bringing new customers. Furthermore, a company can also see the patterns in the behaviour of the visitors on different pages. By using various page analytics techniques, successful as well as problematic pages can be detected. ...

March 15, 2023 · 12 min · Elvin Zeynalli

FIFA23 Players Analysis: k-Means Clustering

This project is carried out by me independently. The dataset is obtained publicly from Kaggle. All codes and their explanations are stored in my GitHub repository. Project description Language: Python Libraries: sklearn, pandas, numpy, matplotlib, seaborn IDE: Jupyter notebook Project type: Machine learning, Unsupervised learning, K-Means clustering FIFA 23 is a football video game created by Electronic Arts (EA). It became the best-selling football video game in Christmas UK retail charts. According to EA statistics, the game contains more than 700 teams with over 19,000 football players, playing in at least 30 football leagues. The data used in this project is taken from Kaggle. The objective of this project is to classify the players into various segments. ...

January 24, 2023 · 8 min · Elvin Zeynalli

Zondo Reports Text Analysis

Project description Language: Python Working file: Jupyter notebook In 2018, former President of South Africa, Jacob Zuma, established a commission of enquiry in state capture, known as The Judicial Commission of Inquiry into Allegations of State Capture, Corruption and Fraud in the Public Sector including Organs of State, or simply the Zondo Commission. The commission collected one exabyte of evidence, and on 22 June 2022 released its final report. The reports are available publicly in this link. ...

January 4, 2023 · 6 min · Elvin Zeynalli