Design Analytics for the Sharing Economy
Having concluded another elective module and being one step closer to graduating my degree, I figured I would leave some thoughts, useful question sheets, and a few short coding scripts I used to review and better digest the content from one of my classes.
Design Analytics for The Sharing Economy (DSAE) was delivered by Bob Shorten, Pietro, and even featured a guest lecture from a relatively new faculty favorite: Pierre Pinson! Going into the module I wasn’t sure what to expect, I just knew I wanted the challenge, I really enjoy Bob’s teaching (and assessment style), and although I was rather – unpleasantly – surprised with the amount of maths in the course it was, in the end, a great experience and aligns with my manifesto which is something like “study the things you aren’t good at and would never motivate yourself to learn outside the classroom environment… even if you don’t do so well.”
As per usual I attended lectures, but didn’t take notes, and left my studying until 5 days before the exam. Despite this, my revision was pleasant. I have to thank ChatGPT for being a terrific assistant as well as helping me generate the scripts that I have attached to this post.
DSAE focuses on the ‘gig’ economy. What motivates and empowers sharing platforms such as Uber, airbnb, EV car charging… anything where multiple users are interacting in a system looking to provide or consume a shared good/service. This makes all the actors in the sharing economy prosumers.
I found this class conceptually intriguing, which carried me through the mathematics. The professor and this year head-of-school, Bob Shorten, is known for Machine Learning and lots of really cool optimisation projects and systems modelling. The sharing economy, although not an entirely new concept, continues to develop in the wake of COVID-19, a rise in conversations around sustainability, and an ever increasing cost of living. The more people that can’t afford to own things, the more participants in the sharing economy.
This ecosystem is an interesting case study in social contracts and human behaviour on a more philosophical and social sciencey note. How do you incentivise people to play fairly and follow the rules in a decentralised and (more often than not) deregulated environment? When the prices and systems benefit these people and are relatively easy to cheat, how do you ensure abbidance by ‘rules’? How do you design the same systems to provide an acceptable quality of service to users, even though they aren’t funded or maintained by a central entity? These are all the interesting things to consider over the course of the module and beyond.
To share the work done on the technical side, I have attached a few different question sheets and python scripts which correspond to lecture topics and theories in attempts to answer some of those same questions from above. You can open the pdfs easily, and the code files are .py so open up any online environment – or download my favourite, VS Code – to run them.
Binomial Distribution
What is the probability of a (discrete) event occurring given a certain number of attempts? For example, out of all the customers looking to order an Uber home after a night out, how many will be successful? This forecasting is important for designing the system!
Quality of Service Metrics
This relates to the Binomial Distribution work, but basically this metric should always be set just less than the probability of successes, to ensure that those in your system will be happy, but realistically happy, with a satisfaction guarantee. Code here.
Queuing Theory
As the name suggests, this theory is all about the design of queues: whenever an individual enters one, how long they stay, what is the rate of service, etc. Code here.
Markov Chains
How to model something that evolves probabilistically, and of course, in stochastic matrices we inspect the Perron eigenvalues, Kemeny constant, and mean first passage times. All of these equations and values represent some important characteristic of the system – from probability of transitioning from one state to the next, to the long term equilibrium distribution, to the overall connectivity of a system. Markov chains can be used to model complicated road networks, or situations as simple as “I am hungry now, and with some probabilities X, Y, Z, I will be sleepy, happy, or maybe even sad later.” Code here.
Shapley Value
Have you ever been out to eat and spent a considerable amount of time at the end discussing with friends how to split a bill? Some are dutch about it, some are overly-generous, some peevish to discuss money, some think that by sitting silently they won’t have to pay a dime, and then of course some get so frustrated with the whole process they offer to pay for everyone. Well in DSAE, we had a lecture on game theory. We focused specifically on super-additive games, in which groups are incentivised to join together in coalitions because their strategy together is stronger and more optimal than going at something alone.
Instead of the restaurant splitting perhaps think of sharing a cab home, where everyone is going in the same direction more or less, and the cost of splitting one cab is more economical than everyone traveling individually. Still, there is some maths to be done over how to split. Applying this theory, there is a Shapley value which represents the fair allocation of cost to each individual based on their marginal contribution to the total. It’s magical because it sums to the total always, and is more optimal for everyone than going alone, always. It’s the only way to split that meets these conditions. Code is here to give it a try yourself.
Additive Increase Multiplicative Decrease Algorithm (AIMD)
AIMD is a congestion algorithm. This means it is all about allocating portions of a shared resource between users and increasing their share until capacity is reached. Thinking of this in terms of bandwidth of a network might make the most sense. If you are in a flat of three, one is studying on their laptop, one is watching Netflix, and one is Facetiming, they are all sharing the flat WiFi. Their portion of the network will be split between them, and slowly everyone will use a bit more of the network, and a bit more, and a bit more, until bam – the capacity is reached. Everyone glitches for a second, or the streaming quality drops, and then we resume the process.
The first part of this process is the additive increase phase, where the flatmates are all slowly getting allocated more of the network according to some coefficient, alpha. The second phase is the multiplicative decrease, in which everyone drops off by a certain amount according to some coefficient, beta. There are different nuances to this algorithm, and the code is here to explore.