question
stringlengths
11
2.89k
code
stringlengths
20
7.24k
Possible new questions and python programs: Alice has 4 more stamps than Bob. Bob has twice as many stamps as Charlie. If Charlie has 6 stamps, how many does Alice have?
def solve() -> int: charlie = 6 bob = 2 * charlie alice = bob + 4 result = alice return result
Rachel is washing clothes. She starts with a washer filled with 50 degree water. Each minute, the temperature of the water increases by 3 degrees. Once the water reaches 100 degrees and is ready for washing, Rachel needs to wash the clothes for 20 minutes. Then it will take her 1/10 of that time to switch the laundry. ...
def solve() -> int: washer_temp = 50 temp_increase = 3 target_temp = 100 wash_time = 20 switch_time = wash_time / 10 temp_difference = target_temp - washer_temp temp_time = temp_difference / temp_increase total_time = wash_time + switch_time + temp_time result = total_...
A box contains 3 red marbles, 5 blue marbles, and 4 green marbles. If two marbles are drawn at random, without replacement, what is the probability that both marbles are blue?
def solve() -> int: total_marbles = 3 + 5 + 4 total_blue_marbles = 5 probability_first_marble_is_blue = total_blue_marbles / total_marbles probability_second_marble_is_blue_given_first_was_blue = (total_blue_marbles - 1) / (total_marbles - 1) probability_both_marbles_are_blue = probability_first_mar...
An ice cream parlor sells double the amount of cones than cups, and make 63 sales this week. How many sales were made for each type of product?
def solve() -> int: cones = 63 / 3 cups = 63 / 6 result = 63 / 3 return result
Lisa has a rectangular garden that is 12 meters long and 9 meters wide. She wants to plant flowers along the perimeter of the garden. She needs one flower for every meter of the perimeter. How many flowers does she need to buy?
def solve() -> int: length = 12 width = 9 perimeter = 2 * (length + width) flowers = perimeter * 1 result = flowers return result
A school has a total of 420 students. The ratio of boys to girls is 4:5. How many boys are there?
def solve() -> int: total_students = 420 boys_ratio = 4/(4+5) boys = boys_ratio * total_students result = boys return result
A farmer has 40 chickens and 20 cows. Each chicken lays 2 eggs per day and each cow produces 10 liters of milk per day. The farmer sells each egg for $0.5 and each liter of milk for $1. How much money does the farmer make in a week?
def solve() -> int: chickens = 40 cows = 20 eggs = chickens * 2 milk = cows * 10 egg_price = 0.5 milk_price = 1 money_from_eggs = eggs * egg_price money_from_milk = milk * milk_price money_per_day = money_from_eggs + money_from_milk days = 7 money_per_week = money_per_day *...
A cake recipe requires 2 1/4 cups of flour for every 1 1/3 cups of sugar. If Julia wants to use the whole bag of 8 cups of flour, how much sugar will she need in cups?
def solve() -> int: amount_of_sugar_required_per_cup_of_flour = (4/3)/(9/4) amount_of_sugar_required = amount_of_sugar_required_per_cup_of_flour*8 result = amount_of_sugar_required return result
arah can solve 7 math problems in 10 minutes. How many math problems can she solve in 45 minutes?
def solve() -> int: problems_per_minute = 7 / 10 total_problems = problems_per_minute * 45 result = total_problems return result
Jasmine read 8 books in two months. How many books per month did she read?
def solve() -> int: total_books = 8 books_per_month = total_books / 2 result = 4.0 return result
A student has $50. She wants to buy 5 packs of pencils, each for $6 and 3 notebooks, each for $8. After the shopping, how much money does she have left?
def solve() -> int: pencil_cost = 6 * 5 notebook_cost = 8 * 3 total_cost = pencil_cost + notebook_cost money_left = 50 - total_cost result = money_left return result
Jack needs to paint a room that is 10 feet wide, 12 feet long, and 8 feet high. If each gallon of paint can cover 350 square feet, how many gallons of paint does Jack need to buy?
def solve() -> int: width = 10 length = 12 height = 8 area = 2 * width * height + 2 * length * height paint_needed = area / 350 result = paint_needed return result
At a museum, there were 2,500 visitors on Monday. Over the course of 5 hours, visitors left the museum at a constant rate of 100 visitors per hour. During the next 6 hours, new visitors arrived at a constant rate. If the final number of visitors at the museum was 4,000, at what rate were new visitors arriving?
def solve() -> int: visitors_on_monday = 2500 visitors_leaving_rate = 100 visitors_arriving_rate = (4000 - visitors_on_monday + (visitors_leaving_rate * 5)) / 6 result = visitors_arriving_rate return result
A rectangular garden is 10 feet wide and 15 feet long. If the garden is doubled in size, what will be the dimensions of the new garden?
def solve() -> int: old_width = 10 old_length = 15 new_width = old_width * 2 new_length = old_length * 2 result = (new_width, new_length) return result
Student: Sam bought 5 pizzas for $14 each and 4 drinks for $3 each. He gave $100 to the cashier. So how much change did he take?
def solve() -> int: pizzas = 5 drinks = 4 pizza_price = 14 drink_price = 3 cash_given = 100 total_cost = pizzas * pizza_price + drinks * drink_price change = cash_given - total_cost result = change return result
A bag contains 15 red jellybeans, 10 blue jellybeans, and 5 orange jellybeans. If you pick a jellybean at random, what is the probability it will not be red?
def solve() -> int: total_jellybeans = 30 red_jellybeans = 15 non_red_jellybeans = total_jellybeans - red_jellybeans prob_non_red = non_red_jellybeans/total_jellybeans result = prob_non_red return result
-Start each new question in a new paragraph. Do not leave any blank lines between questions. Possible new questions and programs are: Henry, Lisa, and Omar collected some coins and counted them. Henry had 15 more coins than Lisa and Lisa had 10 fewer coins than Omar. If Omar had 65 coins, what was the average number of...
def solve() -> int: henry = None lisa = None omar = 65 lisa = omar - 10 henry = lisa + 15 total = henry + lisa + omar average = total / 3 result = average return result
A car travels 300 kilometers on a full tank of gas. The tank has a capacity of 50 liters. The car starts with a full tank and drives 120 kilometers before refilling the tank. How many liters of gas did the car use before refilling?
def solve() -> int: full_distance = 300 full_tank = 50 start_distance = 0 drive_distance = 120 gas_per_km = full_tank / full_distance gas_used = gas_per_km * drive_distance result = gas_used return result
If a pizza has a diameter of 30 cm, what is the area of the pizza?
def solve() -> int: diameter = 30 radius = diameter / 2 pi = 3.14 result = pi * (radius**2) return result
A restaurant has 30 tables with 6 chairs each. If 210 guests can be seated at a time, what is the maximum number of people that can dine in the restaurant at once?
def solve() -> int: tables = 30 chairs_per_table = 6 total_chairs = tables * chairs_per_table maximum_guests = total_chairs // 2 result = maximum_guests return result
Student: There are 20 marbles in a jar, of which 7 are blue, 6 are red, and 7 are white. If Lily randomly draws a marble from the jar, how likely is it that it's not white?
def solve() -> int: total_marbles = 20 blue_marbles = 7 red_marbles = 6 white_marbles = 7 not_white_marbles = total_marbles - white_marbles probability_not_white = not_white_marbles / total_marbles result = probability_not_white return result
Amy has 10 red balloons. She has 3 fewer blue balloons than red balloons. She has 4 times as many yellow balloons as blue balloons. How many balloons does Amy have in all?
def solve() -> int: red = 10 blue = red - 3 yellow = blue * 4 total = red + blue + yellow result = total return result
Mike has some money. He spent $4.25 on a movie ticket and then $1.20 on popcorn. If he had $10 left, how much money, in dollars, did Mike have at first?
def solve() -> int: total_spent = 4.25 + 1.2 initial_money = total_spent + 10 result = initial_money return result
A room has a length of 18 meters and a width of 2 meters. A square has a width of 3 meters. What is the difference in area between the two shapes?
def solve() -> int: length_room = 18 width_room = 2 width_square = 3 area_room = length_room * width_room area_square = width_square ** 2 difference_area = area_room - area_square result = difference_area return result
A construction company uses 500 pounds of cement every day. They decide to increase their cement usage by 8% every quarter. How many pounds of cement will they use in a year?
def solve() -> int: cement_per_day = 500 cement_per_quarter = cement_per_day * 90 cement_per_year = cement_per_quarter * 4 increase_per_quarter = 0.08 total_increase = (1 + increase_per_quarter) ** 4 total_cement_per_year = cement_per_year * total_increase result = total_cement_per_y...
At a park, 3 young people each brought 100 chocolate bars for the picnic. 6 older people each brought 50 chocolate bars. How many chocolate bars were there in total?
def solve() -> int: total_bars = 0 total_bars = total_bars + (3*100) total_bars = total_bars + (6*50) result = total_bars return result
A train traveled 360 miles in 6 hours. What is the average speed of the train, in miles per hour?
def solve() -> int: distance = 360 time = 6 speed = distance/time result = speed return result
A train travels from point A to B at a speed of 60 km/h. It returns to point A at a speed of 72 km/h. What is the average speed for the round trip?
def solve() -> int: speed_AtoB = 60 speed_BtoA = 72 avg_speed = (2*speed_AtoB*speed_BtoA)/(speed_AtoB+speed_BtoA) result = avg_speed return result
A shopping cart can hold up to 60 pounds. David, Mark, and Peter want to buy groceries together. Peter weighs 10 pounds more than Mark, and David is twice as heavy as Peter. How much do they overweight if they put everything in the cart and wheel it at once?
def solve() -> int: mark_weight = 0 peter_weight = 0 david_weight = 0 cart_capacity = 60 mark_weight = cart_capacity / 4 peter_weight = mark_weight + 10 david_weight = peter_weight * 2 total_weight = mark_weight + peter_weight + david_weight overweight = total_weight -...
A chef prepares 25 pizzas for a party. If each guest eats 4 slices, and there are 40 guests, how many slices will be left over?
def solve() -> int: num_pizzas = 25 slices_per_pizza = 8 total_slices = num_pizzas * slices_per_pizza num_guests = 40 slices_per_guest = 4 total_slices_eaten = num_guests * slices_per_guest slices_left_over = total_slices - total_slices_eaten result = s...
A company manufactures and sells pens. It costs the company $0.70 to make each pen. If the company sells the pens for $1.30 each, what is its profit after selling 250 pens?
def solve() -> int: cost_per_pen = 0.7 sale_price_per_pen = 1.30 profit_per_pen = sale_price_per_pen - cost_per_pen total_profit = profit_per_pen * 250 result = total_profit return result
A pizza has 12 slices. Ben eats 2 slices and shares the rest with 5 friends. How many slices does each friend get?
def solve() -> int: slices = 12 slices = slices - 2 slices = slices / 5 result = slices return result
Alex is sorting his toy cars. He wants to save the vintage cars, throw away the broken cars, and keep the sports cars to display. He has 200 cars and one eighth of them are broken and 30 more than half of them are vintage cars. How many cars will he have left to display?
def solve() -> int: total_cars = 200 broken_cars = total_cars / 8 vintage_cars = (total_cars / 2) + 30 display_cars = total_cars - broken_cars - vintage_cars result = display_cars return result
If Emily buys 8 packs of 200 mL yogurt, it will cost $4.80. If she buys them individually, they will cost $0.85 each. How much is Emily's total savings from buying five sets of 8 packs of 200 mL yogurt?
def solve() -> int: packs = 8 volume = 200 cost_per_pack = 4.80 cost_per_individual = 0.85 total_cost = packs * cost_per_pack individual_cost = packs * volume * cost_per_individual savings = total_cost - individual_cost result = savings * 5 return result
Student: A person drives at a constant speed of 60 km/hour. How far can he travel in 2.5 hours?
def solve() -> int: speed = 60 time = 2.5 distance = speed * time result = distance return result
The distance between two cities is 560 kilometers. If a car travels at an average speed of 80 km/h, how many hours will it take to get from one city to the other?
def solve() -> int: time_in_hours = 560 / 80 result = time_in_hours return result
A piece of clothing costs \$80 and is on sale for 25% off. What is the sale price of the clothing item?
def solve() -> int: original_price = 80 percent_off = 25 sale_price = original_price - (original_price * percent_off / 100) result = sale_price return result
Alex is driving from Iowa to Georgia. He has to make a stop in Tennessee which is 665 miles away from Iowa and 565 miles away from Georgia. If Alex is traveling at a speed of 70mph from Iowa to Tennessee and at a speed of 60mph from Tennessee to Georgia, how many hours will it take him to arrive at the destination?
def solve() -> int: distance_from_IA_to_TN = 665 distance_from_TN_to_GA = 565 speed_from_IA_to_TN = 70 speed_from_TN_to_GA = 60 time_in_hours_from_IA_to_TN = distance_from_IA_to_TN/speed_from_IA_to_TN time_in_hours_from_TN_to_GA = distance_from_TN_to_GA/speed_from_TN_to_GA tim...
Lucas likes to collect stickers and magnets. He has 48 stickers and 36 magnets. He decides to give away some of his stickers and magnets to his friends. He gives away 2 stickers for every 3 magnets he gives away. He wants to keep at least 12 stickers and 9 magnets for himself. How many stickers and magnets can he give ...
def solve() -> int: stickers = 48 magnets = 36 stickers_keep = 12 magnets_keep = 9 stickers_giveaway = stickers - stickers_keep magnets_giveaway = magnets - magnets_keep pairs = min(stickers_giveaway // 2, magnets_giveaway // 3) stickers_giveaway = pairs * 2 magnets_giveaway = pairs ...
Student: Maria is planting 100 tulip bulbs. Each row can have up to 10 tulips. How many rows will she need to plant all the tulips?
def solve() -> int: tulips = 100 max_tulips_per_row = 10 rows = tulips // max_tulips_per_row remaining_tulips = tulips % max_tulips_per_row total_rows = rows + (1 if remaining_tulips > 0 else 0) result = total_rows return result
Frank invested 2000 dollars at an annual interest rate of 5.5%. How much profit did he make after 3 years?
def solve() -> int: principal = 2000 interest_rate = 0.055 time_period_years = 3 profit = principal*(1+interest_rate)**time_period_years - principal result = profit return result
A group of friends went to a restaurant and their bill came out to be $72. If the friends decide to split the bill equally and tip 20%, how much will each person pay?
def solve() -> int: bill_amount = 72 num_people = 4 tip_percent = 0.2 total_amount = bill_amount * (1 + tip_percent) cost_per_person = total_amount / num_people result = cost_per_person return result
A company has 50 employees. If the number of employees increases by 20% every quarter, how many employees will the company have at the end of the year?
def solve() -> int: employees = 50 increase = 0.2 quarters = 4 employees_q1 = employees * (1 + increase) employees_q2 = employees_q1 * (1 + increase) employees_q3 = employees_q2 * (1 + increase) employees_q4 = employees_q3 * (1 + increase) total_employees = employees_...
A store sells a gadget for $1200. At a 15% discount sale, what is the selling price of the gadget?
def solve() -> int: original_price = 1200 discount_percent = 15 discount_amount = original_price * (discount_percent/100) selling_price = original_price - discount_amount result = selling_price return result
Student: 5. Ryan has five packets of sweets. Each packet contains two sweets and the five packets weigh 7kg. How much does one sweet weigh?
def solve() -> int: num_packets = 5 num_sweets = 2 total_weight = 7 weight_per_sweet = total_weight / (num_packets * num_sweets) result = weight_per_sweet return result
Jerry bought 10 gadgets for his research project, the total cost is $120. How much did he pay if the gadgets have different prices?
def solve() -> int: total_cost = 120 number_of_gadgets = 10 cost_per_one_gadget = total_cost/number_of_gadgets result = cost_per_one_gadget return result
A bag contains 4 red balls, 7 blue balls, and 9 green balls. What is the probability of picking a green ball, then a blue ball, and then a red ball without replacement?
def solve() -> int: red_balls = 4 blue_balls = 7 green_balls = 9 total_balls = red_balls + blue_balls + green_balls prob_green = green_balls / total_balls prob_blue = blue_balls / (total_balls - 1) prob_red = red_balls / (total_balls - 2) total_prob = prob_green * prob_blue * prob_red ...
A store is having a sale where everything is 15% off. If a shirt that normally costs $40 is on sale, what is the new price of the shirt?
def solve() -> int: cost = 40 discount = 0.15 new_cost = cost - (discount * cost) result = new_cost return result
Student: 6. In a factory, there are 436 employees. 250 of them earn $15 per hour, 126 earns $20 per hour. And the rest earns $25 per hour. What is the total cost to employ all these people for one 8-hour long shift?
def solve() -> int: employees = 436 earn_15 = 250 earn_20 = 126 earn_25 = employees - earn_15 - earn_20 cost_15 = earn_15 * 15 cost_20 = earn_20 * 20 cost_25 = earn_25 * 25 total_cost = cost_15 + cost_20 + cost_25 result = total_cost * 8 return result
A recipe calls for 2 cups of flour and 1 cup of sugar. If the recipe is doubled, how many cups of flour and sugar are needed in total?
def solve() -> int: flour_per_recipe = 2 sugar_per_recipe = 1 doubled_flour = flour_per_recipe * 2 doubled_sugar = sugar_per_recipe * 2 total_flour_sugar = doubled_flour + doubled_sugar result = total_flour_sugar return result
Rachel is wrapping presents. It takes her 5 minutes to wrap a small present and 12 minutes to wrap a large present. If she wraps 5 small presents and 3 large presents, how long does she spend wrapping?
def solve() -> int: num_small_presents = 5 num_large_presents = 3 time_small_present = 5 time_large_present = 12 total_time = num_small_presents * time_small_present + num_large_presents * time_large_present result = total_time return result
Karren walks 1.2km every day. If she does this for 5 days, how many total km did she walk?
def solve() -> int: daily_dist = 1.2 days_walked = 5 total_dist = daily_dist*days_walked result = total_dist return result
John drove for 3 hours with an average speed of 60 miles per hour. How far did John travel?
def solve() -> int: distance = 60 * 3 result = distance return result
Alice is spinning a wheel that has 12 sections, each with a different number from 1 to 12, and won't stop spinning until the average of all her spins is 6. She spins a 4, a 9, a 7, a 3, a 10, a 5, a 8, a 1, a 11 and a 6. What does she need to spin on the next spin to be able to stop?
def solve() -> int: spins = [4, 9, 7, 3, 10, 5, 8, 1, 11, 6] total = sum(spins) count = len(spins) average = total / count target_average = 6 target_total = target_average * (count + 1) next_spin = target_total - total result = next_spin return result
Student: Desi makes candles to sell. She spends $100/week on supplies to make candles which each cost her $3 to make. She then sells them for $5 each. How much money does Desi make in a 7-week period?
def solve() -> int: supplies_cost = 100 candle_cost = 3 candle_price = 5 weeks = 7 candles_per_week = supplies_cost // candle_cost revenue_per_week = candles_per_week * candle_price profit_per_week = revenue_per_week - supplies_cost profit_total = profit_per_week * weeks resu...
Student: If a bag contains 30 marbles and 6 of them are green, what is the percentage of green marbles in the bag?
def solve() -> int: total_marbles = 30 green_marbles = 6 fraction = green_marbles / total_marbles percentage = round(fraction * 100, 2) result = percentage return result
Jillian goes to the gas station and buys 10.5 gallons of gasoline for $31.50. What is the cost per gallon of gas?
def solve() -> int: cost_per_gallon = 31.5/10.5 result = cost_per_gallon return result
John has three times as many books as Sarah, but Lily has four times as many books as John. If there are 140 books altogether, how many books does Lily have?
def solve() -> int: sarah_books = 140 / (1 + 3 + 4) john_books = 3 * sarah_books lily_books = 4 * john_books result = lily_books return result
Student: A train travels a distance of 300 km from A to B at a speed of 60 km/h. On the return trip from B to A, the train travels at a speed of 40 km/h. What is the average speed (in km/h) for the entire trip?
def solve() -> int: distance = 300 speed_AB = 60 speed_BA = 40 time_AB = distance / speed_AB time_BA = distance / speed_BA total_time = time_AB + time_BA result = distance / total_time return result
A box contains 150 chocolates. 15 of them are dark chocolates. What percentage of chocolates in the box are dark?
def solve() -> int: total_chocolates = 150 dark_chocolates = 15 percentage_dark = (dark_chocolates/total_chocolates)*100 result = percentage_dark return result
A walking path is 2 meters wide and 88 meters long. How much area does the path cover?
def solve() -> int: width = 2 length = 88 area = width * length result = area return result
Ashley wants to purchase a phone that costs $750. If she only has $500, how much more money does she need?
def solve() -> int: phone_cost = 750 ashley_money = 500 money_needed = phone_cost - ashley_money result = money_needed return result
Michelle's handbag contains 30 blue coins and 18 pink coins. She adds another 12 blue coins to her handbag. If she counted her coins by pairing⁠—blue coins with blue coins and pink coins with pink coins⁠—how many pairs of coins did she have?
def solve() -> int: blue_coins = 30 + 12 pink_coins = 18 result = min(blue_coins, pink_coins) return result
Mia paints 70% as many canvases as brushes in her art studio. Noah paints twice as many brushes as Mia and 40% as many canvases as brushes. If Noah paints 120 brushes, what is the total number of canvases and brushes that Mia and Noah paint in their art studio?
def solve() -> int: noah_brushes = 120 noah_canvases = 0.4 * noah_brushes mia_brushes = noah_brushes / 2 mia_canvases = 0.7 * mia_brushes total = noah_canvases + noah_brushes + mia_canvases + mia_brushes result = total return result
Student: Jill biked 14 kilometers in 45 minutes. What was her average speed in meters per second?
def solve() -> int: kilometers = 14 meters = kilometers * 1000 minutes = 45 seconds = minutes * 60 average_speed = meters / seconds result = average_speed return result
Jared has a house with 30 windows. Out of the 30 windows, 15 are open and the rest are closed. How many windows are closed?
def solve() -> int: total_windows = 30 windows_open = 15 window_closed = 0 window_closed = total_windows - windows_open result = window_closed return result
The final answer is $8. This is the amount of profit that Marco made from selling 40 cups of lemonade. Nina is a tutor. She charges $30 per hour for math and $25 per hour for English. She also gives a 10% discount for students who book 5 or more hours of tutoring in a week. Kyle booked 3 hours of math and 4 hours of En...
def solve() -> int: math_price = 30 * 3 english_price = 25 * 4 original_price = math_price + english_price total_hours = 3 + 4 if total_hours >= 5: discount = original_price * 0.1 else: discount = 0 final_price = original_price - discount result = final_price return resul...
Student: Alex consumes 50 calories for every hour that he exercises. If he exercised for 5 hours, how many calories did he consume in total?
def solve() -> int: calories_per_hour = 50 hours_exercised = 5 total_calories = calories_per_hour * hours_exercised result = total_calories return result
Max wants to know how much he traveled last week. He traveled 10 miles on Monday and 5 more miles on Tuesday. He traveled twice as much on Wednesday. He didn't travel at all on Thursday, but traveled 15 miles on Friday. What was the daily average distance Max traveled last week?
def solve() -> int: monday_distance = 10 tuesday_distance = 5 wednesday_distance = 2 * (monday_distance + tuesday_distance) thursday_distance = 0 friday_distance = 15 total_distance = monday_distance + tuesday_distance + wednesday_distance + thursday_distance + friday_distance average_d...
A group of 4 friends want to split the cost of a $100 Airbnb rental for the weekend. If they also want to buy groceries together and spend a total of $120, how much money should each person contribute in total?
def solve() -> int: rental_cost = 100 grocery_cost = 120 num_friends = 4 total_cost = rental_cost + grocery_cost cost_per_person = total_cost / num_friends result = cost_per_person return result
The ratio of the number of boys to girls in a class is 2:3. If there are 24 boys, how many girls are there in the class?
def solve() -> int: number_of_boys = 24 ratio_of_boys_to_girls = 2/3 number_of_girls = round(number_of_boys / ratio_of_boys_to_girls) - number_of_boys result = number_of_girls return result
Tina bakes 48 muffins. She sells 75% of them for $2 each, and donates the rest to a charity. How much money does Tina make from selling the muffins?
def solve() -> int: muffins_sold = 0.75 * 48 money_made = muffins_sold * 2 result = money_made return result
A dress initially costs $200, but the price is reduced by 25%. What is the new price?
def solve() -> int: original_price = 200 discount_rate = 0.25 new_price = original_price - (original_price*discount_rate) result = new_price return result
Ethan is stocking up on pasta. He got 15 boxes at the supermarket, and had 6 coupons for 45 cents off a single box per coupon. He paid $27 and got $9 in change. How many cents does a box of pasta cost?
def solve() -> int: boxes = 15 coupons = 6 coupon_value = 45 total_paid = 27 * 100 change = 9 * 100 total_discount = coupons * coupon_value total_cost = total_paid - change + total_discount cost_per_box = total_cost / boxes result = cost_per_box return result
An IT service provider has a call center. On average, the center receives 100 calls per hour. The average talk time for a call is 5 minutes and the average time between calls is 1 minute. How many operators does the company need to hire to ensure that no customer has to wait for more than 2 minutes?
def solve() -> int: calls_per_hour = 100 calls_per_minute = calls_per_hour / 60 avg_talk_time = 5 avg_time_between_calls = 1 max_wait_time = 2 time_per_call = avg_talk_time + avg_time_between_calls num_operators = calls_per_minute * (max_wait_time/time_per_call) result = num_operators...
The average of 5 numbers is 25. If 3 of the numbers are 20, 25, and 35, what is the sum of the remaining 2 numbers?
def solve() -> int: total_numbers = 5 sum_of_5_numbers = 25 * total_numbers sum_of_given_numbers = 20 + 25 + 35 sum_of_remaining_numbers = sum_of_5_numbers - sum_of_given_numbers result = sum_of_remaining_numbers return result
Alexander has 225 marbles. He wants to distribute them evenly between his 9 friends. How many marbles will each friend receive?
def solve() -> int: total_marbles = 225 num_of_friends = 9 marbles_per_friend = total_marbles // num_of_friends result = marbles_per_friend return result
Tom has 18 donuts and wants to share them equally among his 3 coworkers. How many donuts will each coworker get?
def solve() -> int: num_donuts = 18 num_coworkers = 3 donuts_per_coworker = num_donuts / num_coworkers donuts_per_coworker = round(donuts_per_coworker) result = donuts_per_coworker return result
Eighty candies were shared equally among 4 kids. What is the total number of candies that two of the kids received combined?
def solve() -> int: candies = 80 kids = 4 candies_per_kid = candies / kids total_candies_received = candies_per_kid * 2 result = total_candies_received return result
Tom bought some books for his book club. He bought 6 fiction and 9 non-fiction books for $98 total. If the non-fiction books cost $13, how much did each fiction book cost?
def solve() -> int: fiction_books = 6 non_fiction_books = 9 total_cost = 98 non_fiction_cost = 13 fiction_cost = (total_cost - (non_fiction_books * non_fiction_cost)) / fiction_books result = fiction_cost return result
A train runs twice a day, from point A to point B and back. The train covers 200 kilometers from A to B in the morning and 300 kilometers from B to A in the evening. How many days will it take for the train to cover 8000 kilometers total?
def solve() -> int: distance_AB = 200 distance_BA = 300 total_distance = 8000 distance_per_day = distance_AB + distance_BA days_to_cover_total_distance = total_distance / distance_per_day result = days_to_cover_total_distance return result
A restaurant sells three types of sandwiches: ham and cheese for $5, turkey for $6, and roast beef for $7. If the restaurant sells 100 ham and cheese sandwiches, 50 turkey sandwiches, and 30 roast beef sandwiches, how much money did they make from sandwich sales?
def solve() -> int: ham_cheese_price = 5 turkey_price = 6 roast_beef_price = 7 ham_cheese_sold = 100 turkey_sold = 50 roast_beef_sold = 30 ham_cheese_revenue = ham_cheese_sold * ham_cheese_price turkey_revenue = turkey_sold * turkey_price roast_beef_revenue = roast_beef_sol...
The sequence of Fibonacci numbers starts with 1, 1, 2, 3, 5, 8, 13 and so on. If the nth Fibonacci number is 144, what is the value of n?
def solve() -> int: fibonacci_number = 144 previous_fibonacci_number = 1 current_fibonacci_number = 1 counter = 2 while current_fibonacci_number < fibonacci_number: next_fibonacci_number = previous_fibonacci_number + current_fibonacci_number previous_fibonacci_number = current_fibona...
A gardener plants 3 rows of flowers per day, and each row has 20 flowers. How many flowers does the gardener plant during 1 week?
def solve() -> int: rows_per_day = 3 flowers_per_row = 20 flowers_per_day = rows_per_day * flowers_per_row days_per_week = 7 result = flowers_per_day * days_per_week result return result
A pizza place charges $10 for a small pizza and $15 for a large pizza. If you buy 3 small pizzas and 2 large pizzas, how much will it cost?
def solve() -> int: small_price = 10 large_price = 15 num_small = 3 num_large = 2 total_cost = (small_price * num_small) + (large_price * num_large) result = total_cost return result
Student: A rectangle has a length of 10 inches and a width of 5 inches. What is its area in square inches?
def solve() -> int: length = 10 width = 5 area = length * width result = area return result
Fred had 16 cookies and gave away a fourth of them. He then ate half of the remaining cookies. How many cookies does Fred have left?
def solve() -> int: orig_cookies = 16 given_away = orig_cookies / 4 remaining = orig_cookies - given_away num_left = remaining / 2 result = num_left return result
If a toy car costs $30, and the store requires a 10% deposit, how much is the deposit?
def solve() -> int: cost = 30 deposit = 0.1 * cost result = deposit return result
Mike can solve a puzzle 75% faster than Sarah. If Sarah takes 30 minutes to solve a puzzle, how long would it take Mike to solve 4 puzzles?
def solve() -> int: sarah_time = 30 mike_time = sarah_time * 0.25 mike_puzzles = 4 mike_total_time = mike_time * mike_puzzles result = mike_total_time return result
Student: A rectangle has a length of 12cm and a width of 6cm. What is the perimeter of the rectangle?
def solve() -> int: length = 12 width = 6 perimeter = 2 * (length + width) result = perimeter return result
Pineapples used to cost $3.1 per pound. The price got raised 25%. How much does it cost to buy 3 pounds of pineapple for each person in a group of 7?
def solve() -> int: pineapple_price = 3.1 weight = 3 price_increase = 0.25 num_people = 7 new_price = pineapple_price + (pineapple_price * price_increase) total_cost = new_price * weight group_cost = total_cost * num_people result = group_cost return result
A company produced twice as many laptops as desktops, spending $1000 on a desktop and $2000 on a laptop. If they spent a total of $60,000 on the production, and 50 desktops were produced, how many laptops were produced?
def solve() -> int: desktops = 50 laptops = 2 * desktops desktop_cost = 1000 laptop_cost = 2000 total_cost = desktops * desktop_cost + laptops * laptop_cost total_cost = 60000 laptops = (total_cost - desktops * desktop_cost) / laptop_cost result = laptops return result
A bookshelf can hold 80 books. If each row can have 4 books, how many rows are there in the bookshelf?
def solve() -> int: rows = 80 / 4 result = int(rows) return result
There are 36 students in a classroom. Each table can seat 4 students. How many tables are required to seat all the students?
def solve() -> int: students_in_class = 36 students_per_table = 4 tables_required = students_in_class/students_per_table result = tables_required return result
A bag of rice weighing 2 kg costs $6.50. How much would it cost to buy enough rice to make 8 servings if you need 150 g of rice per serving?
def solve() -> int: rice_weight = 2 rice_cost = 6.50 num_servings = 8 rice_per_serving = 0.15 total_rice = num_servings * rice_per_serving total_cost = total_rice / rice_weight * rice_cost result = total_cost return result
A car consumes 5 liters of gas per 100 km. The car has a full tank of 40 liters of gas. The driver drives from city A to city B, which are 200 km apart, then from city B to city C, which are 150 km apart. How much gas is left in the tank when the driver reaches city C?
def solve() -> int: total_distance = 200 + 150 total_gas = total_distance * 5 / 100 gas_left = 40 - total_gas result = gas_left return result
Student: Noah makes smoothies. For each smoothie, he uses 1/2 cup of yogurt, 1/4 cup of milk and 1 cup of frozen fruit. If he makes 3 less than 12 smoothies, what will be the total amount of yogurt and milk he used in pints?
def solve() -> int: smoothies = 12 yogurt_per_smoothie = 0.5 milk_per_smoothie = 0.25 total_smoothies = smoothies - 3 total_yogurt = total_smoothies * yogurt_per_smoothie total_milk = total_smoothies * milk_per_smoothie total_yogurt_milk = total_yogurt + total_milk total_yogurt_milk_in_p...
A pizza that regularly costs $12 is now sold at a discounted price of $8. If you buy 3 pizzas, how much will you save via discounts?
def solve() -> int: regular_price = 12 discounted_price = 8 quantity = 3 total_regular_price = regular_price * quantity total_discounted_price = discounted_price * quantity total_savings = total_regular_price - total_discounted_price result = total_savings return resu...
Janice has 12 apples. She wants to distribute them equally among 3 friends. How many apples will each friend get?
def solve() -> int: num_apples = 12 num_friends = 3 apples_per_friend = num_apples / num_friends result = apples_per_friend return result
Sophie wants to buy a phone case that costs $20. She has already saved $5. How many days does she need to save for the remaining amount if she saves $0.75 per day?
def solve() -> int: days_to_save = (20-5)/0.75 result = int(round(days_to_save)) return result