Lab 5 — ATM Transactions
Skills: 2, 3, 12
Introduction
In this lab, you'll work with a dataset of ATM transactions and practice using list operations to analyze this data. Each transaction includes information such as: account ID, type of transaction (withdrawal, deposit, or transfer), transaction amount, date, location, and balance after transaction.
Problem 1
Extract the "amount" column from the transactions table and use it to answer the following questions:
a) What is the total amount of all transactions?
b) What is the average transaction amount?
c) What is the largest transaction amount?
d) What is the smallest transaction amount?
Problem 2
Create a function called is-withdrawal
that takes a transaction type as input and returns true if it's a withdrawal. Then, use this function with filter to get a list of all withdrawal amounts from the transaction data and define a constant TOTAL-WITHDRAWAL
that stores the total amount withdrawn.
Problem 3
Extract the "location" column from the transactions table, then use the distinct
function to find all unique ATM locations where transactions occurred.
Define a constant NUM-UNIQUE-LOCATIONS
to store how many unique locations there are.
Problem 4
Write a function transaction-description
that takes a row from the transactions table and returns a string describing the transaction in the following format: "[account] [type] $[amount] at [location] on [date]". Then, use map
to create a list of transaction descriptions for all transactions.
Problem 5
In the USA, Temporary Assistance for Needy Families (TANF) is a federal program, administered by individual states, that provides temporary financial assistance to low- or no-income families to help pay for food, shelter, utilities, and other expenses. In 2024, the median monthly TANF benefit was $552 for a family of three (https://www.nccp.org/publication/a-50-state-comparison-of-tanf-amounts/). TANF benefits are loaded onto Electronic Benefits Transfer (EBT) cards that can be used like debit cards.
In 2014, Maine's governor Paul LePage released a list of 3,650 ATM transactions in which TANF recipients in Maine withdrew cash from ATMs in smoke shops, liquor stores, or out-of-state locations. In an effort to convince people that TANF recipients are defrauding other taxpayers, LePage used these data to argue that TANF recipients were spending their benefits on alcohol, tobacco, etc.
Question: The data that LePage cited do not justify the conclusion he reached. Write two or three sentences explaining why.
Problem 6
Imagine you were tasked with designing a program to identify fraudulant transactions.
Errors in fraud detection can prevent people from accessing their money, cause stigma, and otherwise burden already vulnerable populations. No matter how well-designed an algorithm is, it's likely that errors will still occur.
The degree to which an error in fraud detection impacts somebody (what they have at stake) can depend on their situation. When individuating stakeholders, you might need to consider such variation.
Consider that the program you are tasked to build for identifying ATM fraud will result in people losing access to their accounts for a whole day while they confirm that the transaction was not fraudulant. One type of stakeholder here will be the person who has access to another bank account or credit card. For this stakeholder, she suffers a mere inconvenience. Come up with two other types of stakeholders, differentiated based on circumstance. Then identify a corresponding interest for each stakeholder that might be at stake when a fraud detection error is made.
Stakeholders | Interest/Value |
---|---|
Stakeholder 1 (has another bank account) | convenience |
Stakeholder 2 | [to be filled in] |
Stakeholder 3 | [to be filled in] |
Write your answerse as comments in the file.