Dataset Viewer
Auto-converted to Parquet Duplicate
question
stringlengths
11
2.89k
code
stringlengths
54
2.99k
Ben has a cookie jar and wants to fill it with cookies. It takes 15 seconds to package a single cookie and he needs 240 cookies to fill the jar. If he keeps working at the same pace, how many minutes does it take him to package all the cookies?
def solve() -> int: time = 0 cookies = 0 while cookies < 240: cookies = cookies + 1 time = time + 15 result = time/60 return result
In a bakery, Tom bakes 20 bread loaves every day for 7 days. At the end of the week, Susan comes and buys 25% of the bread loaves. Each bread loaf requires 3 packets of butter. How many packets of butter are needed to butter the remaining bread loaves?
def solve() -> int: total_bread_loaves = 20 * 7 bought_bread_loaves = total_bread_loaves * 0.25 remaining_bread_loaves = total_bread_loaves - bought_bread_loaves butter_packets_needed = remaining_bread_loaves * 3 result = butter_packets_needed return result
Alex purchases two sets of golf clubs for $500 each and three golf bags for $150 each. He gets a 20% discount on all the items. How much does he spend in total?
def solve() -> int: price_per_club = 500 price_per_bag = 150 discount = 0.2 total_club_cost = 2 * price_per_club total_bag_cost = 3 * price_per_bag total_cost = total_club_cost + total_bag_cost discounted_cost = total_cost * (1 - discount) result = discounted_cost retu...
Rachel and her roommate need to save $1,500 for rent. If they each save $75 per week, how many weeks will it take for them to save enough money?
def solve() -> int: savings_weekly = 75 savings_goal = 1500 total_savings = savings_goal * 2 weeks = total_savings / (savings_weekly * 2) result = weeks return result
At a school bake sale, the jar of cookies had 3 times as many cookies as the jar of brownies. The jar of brownies had 15 more brownies than the jar of cupcakes. If the cupcake jar had 30 cupcakes, how many cookies were in the cookie jar?
def solve() -> int: cupcake_count = 30 brownie_count = cupcake_count + 15 cookie_count = brownie_count * 3 result = cookie_count return result
A store sells shirts for $25 each. If they sell 40 shirts, how much total revenue will they make?
def solve() -> int: shirt_price = 25 num_shirts = 40 total_revenue = shirt_price * num_shirts result = total_revenue return result
If there are 25 people attending a basketball game, each with 2 feet, how many pairs of shoes are needed for everyone to have a complete set of shoes for both feet?
def solve() -> int: total_feet = 25 * 2 pairs_of_shoes = total_feet // 2 result = pairs_of_shoes return result
Sarah has a collection of stickers and decides to give away a quarter of her collection to her sister. After giving away the stickers, she's left with 75. If Sarah had given her sister the same number of stickers each time, how many stickers did Sarah have originally?
def solve() -> int: x = 75 * 4 / 3 result = x return result
Kara drove for 1/4 an hour on Monday, drove for 1/3 of an hour on Tuesday, sat in traffic for 2/5 of an hour on Wednesday, drove for 1/2 an hour on Thursday and drove for 1 hour on Friday. How much time did Kara spend driving from Monday to Friday?
def solve() -> int: driving_monday = 1/4 driving_tuesday = 1/3 sitting_wednesday = 2/5 driving_thursday = 1/2 driving_friday=1 total_driving = driving_monday + driving_tuesday + sitting_wednesday + driving_thursday + driving_friday result = total_driving return result
Lana is buying some books for her class. Each book costs $12. She has a coupon that gives her 10% off the total purchase. She also has to pay 8% sales tax on the discounted amount. If she buys 15 books, how much does she pay in total?
def solve() -> int: book_cost = 12 #each book num_books = 15 #number of books original_total = book_cost * num_books coupon_percent = 10 / 100 #convert 10% to decimal discount_amount = coupon_percent * original_total discounted_total = original_total - discount_amount tax_percent = 8 / 100 #...
If Matteo ran twice as far as Kristin, and Kristin ran 3.5 miles, then how far did Matteo run?
def solve() -> int: kristin_miles = 3.5 matteo_miles = 2 * kristin_miles result = matteo_miles return result
A mom buys 3 burgers and 5 tacos for her sons. She gets a special deal in which the burgers cost $5 each and the tacos cost $3 each. How much money did she save compared to what she would have paid if the burgers were $7 each and the tacos were $4 each?
def solve() -> int: burger_normal_price = 7 burger_special_price = 5 taco_normal_price = 4 taco_special_price = 3 burger_amount = 3 taco_amount = 5 normal_total_price = (burger_normal_price*burger_amount) + (taco_normal_price*taco_amount) special_total_price = (burger_special_price*...
A car travels at a rate of 60 miles per hour. How long will it take the car to travel 180 miles?
def solve() -> int: distance = 180 speed = 60 time = distance / speed result = time return result
A candy jar contains 80 pieces of candy. If the ratio of the number of red candies to blue candies in the jar is 3:5, how many red candies are in the jar?
def solve() -> int: candy_jar = 80 red_to_blue_ratio = 3/5 red_candies = candy_jar * red_to_blue_ratio result = red_candies return result
Ethan paid $15 for a toy car and 3 action figures for $7 each. How much did he spend on toys total?
def solve() -> int: # Step 1: Calculate the total cost of the action figures (3 figures * $7/figure) # Step 2: Add the cost of the toy car to the total cost of the action figures # Step 3: Print the total cost of the toys total_action_figures_cost = 3 * 7 total_cost = total_action_figures_cost + 15 ...
The price of a shirt is $24.75 after a discount of 15% is applied. What was the original price of the shirt?
def solve() -> int: discounted_price = 24.75 discount_percent = 15 original_price = discounted_price / (1 - discount_percent/100) result = original_price return result
Student: The height of a red building is twice the height of an orange building. The height of the orange building is 3 times taller than a yellow tree. If the yellow tree is 12 meters tall, what is the combined height of the red building and the orange building in meters?
def solve() -> int: red_building_height = 0 orange_building_height = 0 yellow_tree_height = 12 orange_building_height = yellow_tree_height * 3 red_building_height = orange_building_height * 2 combined_height = red_building_height + orange_building_height result = combined_height return ...
In a school cafeteria, they use 5 pounds of pasta to make sauce for 20 servings of pasta. If they need to make sauce for 60 servings, how many pounds of pasta do they need?
def solve() -> int: pasta_per_serving = 5/20 pasta_for_60_servings = pasta_per_serving*60 result = pasta_for_60_servings return result
Result: 254 A farmer has three fields with a combined total area of 865 acres. The first two fields have areas of 345 and 187 acres respectively. What is the area of the third field?
def solve() -> int: total_area = 865 area_of_first_field = 345 area_of_second_field = 187 area_of_third_field = total_area - (area_of_first_field + area_of_second_field) result = area_of_third_field return result
In a park, there are 35 park benches and 10 picnic tables. If each park bench has 4 legs and each picnic table has 6 legs, how many legs in total are there?
def solve() -> int: park_benches = 35 picnic_tables = 10 legs_per_bench = 4 legs_per_table = 6 total_legs = (park_benches * legs_per_bench) + (picnic_tables * legs_per_table) result = total_legs return result
Ben is counting the number of candy bars in a vending machine with two sections. Section A has 50 candy bars and one subsection, and Section B has 15 more candy bars than twice as many as the combined number of candy bars in Section A. How many candy bars does Section B have?
def solve() -> int: section_a = 50 section_b = 0 section_b = 2 * section_a + 15 result = section_b return result
Carl is a landscaper who charges $25 per hour for his services. He works on different projects every week, and the number of hours he spends on each project varies. Last week, he worked on 4 projects: A for 6 hours, B for 4 hours, C for 8 hours, and D for 5 hours. How much money did he earn last week, if he also receiv...
def solve() -> int: money = 0 hours = [6, 4, 8, 5] for hour in hours: amount = hour * 25 + hour * 25 * 0.1 money += amount result = money return result
Mia went to the pet store and bought 22 bags of dog food and 19 cans of cat food. To feed her pets, Mia needs 2 bags of dog food and 3 cans of cat food each day. After feeding her pets for the maximum number of days she can with the food she bought, how many bags of dog food would she have left over?
def solve() -> int: food_bought = 22 + 19 dog_food_needed_per_day = 2 cat_food_needed_per_day = 3 dog_food_left_over = (food_bought - (dog_food_needed_per_day * (food_bought//dog_food_needed_per_day))) result = dog_food_left_over return result
A car manufacturer produces 1000 vehicles in a month. If 65% of the vehicles are sedans and 4/5 of the sedans are automatic, how many automatic sedans are produced in a month?
def solve() -> int: total_vehicles = 1000 sedan_percentage = 0.65 sedans = total_vehicles * sedan_percentage automatic_sedans = sedans * (4 / 5) result = automatic_sedans return result
- Lily is making a salad. She uses spinach (7 calories per cup), tomatoes (32 calories per cup), cucumber (16 calories per cup), and cheese (110 calories per ounce). She also makes a dressing with 1/4 cup of olive oil (477 calories), 2 tablespoons of vinegar (6 calories), and 1 teaspoon of salt (0 calories). She mixes ...
def solve() -> int: spinach_calories = 7 * 4 # 4 cups of spinach tomato_calories = 32 * 2 # 2 cups of tomatoes cucumber_calories = 16 * 1.5 # 1.5 cups of cucumber cheese_calories = 110 * 2 # 2 ounces of cheese salad_calories = spinach_calories + tomato_calories + cucumber_calories + cheese_calories ...
A local restaurant offers a lunch special that includes a sandwich, a drink, and a bag of chips for $8.50. Additionally, there is a tax of 10.25%. How much will Tim pay for two lunch specials?
def solve() -> int: price = 8.50 tax = 0.1025 total_price = (price + (price * tax)) * 2 result = total_price return result
Emily received $100 in November. She saved $50 in December and $35 in January. Then she spent $70 on a laptop and $15 on a phone case. How much money does Emily have left?
def solve() -> int: amount_received = 100 amount_saved1 = 50 amount_saved2 = 35 amount_spent1 = 70 amount_spent2 = 15 total_amount = amount_received + amount_saved1 + amount_saved2 - amount_spent1 - amount_spent2 result = total_amount return result
Julia is catering for a party with 25 loaves of bread. She cuts each loaf into halves, before cutting them in half again. She then gives everyone 12 portions. How many people can she feed?
def solve() -> int: loaves_of_bread = 25 halves_of_bread = loaves_of_bread * 2 quarters_of_bread = halves_of_bread * 2 portions_of_bread = quarters_of_bread * 12 people_fed = portions_of_bread result = people_fed return result
No newline Possible questions and programs: Lisa sells lemonade for charity. She charges $0.50 for a small cup and $1 for a large cup. On Monday, she sells 40 small cups and 20 large cups. On Tuesday, she sells 30 small cups and 25 large cups. How much money does she raise in total?
def solve() -> int: small_price = 0.5 large_price = 1 monday_small = 40 * small_price monday_large = 20 * large_price monday_total = monday_small + monday_large tuesday_small = 30 * small_price tuesday_large = 25 * large_price tuesday_total = tuesday_small + tuesday_large ...
Emma wants to buy a new outfit for her friend's wedding. She wants to buy a dress which costs $80, shoes which cost $50, and jewelry which costs $30. If she has a coupon that gives her a 20% discount on the entire purchase, how much will she have to pay?
def solve() -> int: dress_cost = 80 shoes_cost = 50 jewelry_cost = 30 discount = 0.2 total_cost = dress_cost + shoes_cost + jewelry_cost discount_amount = total_cost * discount total_cost_after_discount = total_cost - discount_amount result = total_cost_after_discount return result
There are 8 books on a shelf. Each book has 120 pages. If 25% of the pages are torn out, how many pages are left on the shelf?
def solve() -> int: total_pages = 8 * 120 torn_pages = 0.25 * total_pages left_pages = total_pages - torn_pages result = left_pages return result
Mary wants to paint her bedroom and knows that the room is 12 feet tall, 15 feet wide and 20 feet long. If she needs to paint 2 coats and each gallon covers 400 square feet, how many gallons of paint does she need?
def solve() -> int: height = 12 width = 15 length = 20 # total surface area of the walls and ceiling (excluding the floor) total_area = 2 * (height * width + height * length) # gallons needed for 1 coat gallons_for_1_coat = total_area / 400 # gallons needed for 2 coats gallons_requir...
Possible new questions and programs are: Anna has 150 chocolate bars. She gives away 20% of them to her friends and eats 10 of them herself. She then sells the remaining bars for $0.5 each and uses the money to buy candies. A candy costs $0.1. How many candies can she buy?
def solve() -> int: chocolate_bars = 150 give_away = 0.2 eat = 10 sell_price = 0.5 candy_price = 0.1 left = chocolate_bars - chocolate_bars * give_away - eat money = left * sell_price candies = money / candy_price result = candies return result
In a beauty pageant, the winner received 65% of the votes and the runner-up received the remaining votes. If there were 500 participants in the pageant but only 20% of them voted, how many more votes did the winner receive than the runner-up?
def solve() -> int: total_participants = 500 voting_percentage = 20 winner_percentage = 65 total_votes = total_participants * (voting_percentage / 100) votes_for_winner = total_votes * (winner_percentage / 100) votes_for_runner_up = total_votes - votes_for_winner difference_in_votes = votes_...
If you need to travel from New York to Miami, which is approximately 1200 miles away, and you want to make two stops on the way, 400 miles apart from each other, how many miles do you have to drive each day if you need to arrive in Miami in 7 days?
def solve() -> int: total_distance = 1200 num_stops = 2 distance_between_stops = 400 total_driving_distance = total_distance - (num_stops * distance_between_stops) days = 7 driving_distance_per_day = total_driving_distance/(days - num_stops) result = driving_distance_per_day return resul...
Jason has $60 in his piggy bank. He spends $20 on a video game and $15 on a pizza. How much money does Jason have left?
def solve() -> int: money_in_piggy_bank = 60 video_game_cost = 20 pizza_cost = 15 money_left = money_in_piggy_bank - (video_game_cost + pizza_cost) result = money_left return result
Result: 456000 There are 60 students in a class. If each student pays a $5 fee for a field trip, how much money is collected?
def solve() -> int: num_students = 60 fee_per_student = 5 total_money_collected = num_students * fee_per_student result = total_money_collected return result
Jackson invested $5000 in a stock market that offers a 10% annual interest rate. After 3 years, how much money will he have in his investment account?
def solve() -> int: principal_amount = 5000 interest_rate = 0.1 num_years = 3 total_amount = principal_amount*(1+interest_rate)**num_years result = total_amount return result
A cylinder has a radius of 5 cm and a height of 10 cm. What is the volume of the cylinder?
def solve() -> int: from math import pi cylinder_volume = pi * (5 ** 2) * 10 result = cylinder_volume return result
Paul and Sarah are going to a picnic. It takes Paul 2.5 hours to get to the picnic spot, while Sarah takes three times as long. If Paul leaves at 11 AM, at what time should Sarah leave in order for both of them to arrive at the same time?
def solve() -> int: time_for_Paul = 2.5 departure_time_Paul = 11 time_for_Sarah = time_for_Paul * 3 departure_time_Sarah = departure_time_Paul + time_for_Sarah result = departure_time_Sarah return result
Jake wants to buy new sneakers and has two options. The first pair costs $70 and the second pair is two times as costly as the first one. If Jake decides to buy two pairs of each, how much would he have to spend?
def solve() -> int: single_sneaker_cost = 70 total_cost = (2 * single_sneaker_cost) + (2 * 2 * single_sneaker_cost) result = total_cost return result
Jackson bought 3 dozen rulers at $0.50 per ruler. What was the total cost of the rulers that he bought?
def solve() -> int: ruler_price = 0.50 dozen = 3 ruler_cost = ruler_price * 12 total_cost = ruler_cost * dozen result = total_cost return result
-Below are some possible new questions and corresponding python programs, you can refer to them for the format and difficulty level, but do not copy them. There are 8 sheep and 12 cows in a farm. Each sheep produces 4 liters of milk per day and each cow produces 10 liters of milk per day. How many liters of milk does t...
def solve() -> int: sheep = 8 cows = 12 sheep_milk = 4 cow_milk = 10 milk_per_day = sheep * sheep_milk + cows * cow_milk milk_per_week = milk_per_day * 7 result = milk_per_week return result
A buy-one-get-one-free deal is applied to a pair of shoes. If each pair costs $50, what is the cost of buying 3 pairs of shoes?
def solve() -> int: price = 50 pairs = 3 cost = pairs * price - price result = f'{cost}' result = cost return result
In a basket of flowers, two-thirds of them are roses and the rest are lilies. If there are 120 flowers in total, how many lilies are there?
def solve() -> int: total_flowers = 120 roses = (2/3) * total_flowers result = total_flowers - roses return result
Liam’s age is 1/3rd the age of his grandfather. His grandfather is five times the age of Liam’s father. If Liam’s father is 40 years old, how old is Liam?
def solve() -> int: # variable for Liam's father's age father_age = 40 # calculate grandfather's age grandfather_age = father_age * 5 # calculate Liam's age liam_age = grandfather_age * 1/3 result = liam_age return result
A pizza has a diameter of 16 inches. What is the area of the pizza to the nearest square inch?
def solve() -> int: diameter = 16 radius = diameter / 2 pi = 3.14159 area = pi * (radius ** 2) result = round(area) return result
Sam is carrying water bottles for his team. One bottle can hold 500 ml of water. He has to carry 4 liters of water. How many extra ml of water can he carry if he buys 10 bottles?
def solve() -> int: bottle_capacity = 500 # ml required_water = 4 * 1000 # liters to ml num_bottles = 10 total_capacity = bottle_capacity * num_bottles extra_water = total_capacity - required_water result = extra_water return result
A farmer has 784 apples. He wants to sell them in baskets that can hold 24 apples each. How many baskets can he fill?
def solve() -> int: apples = 784 apples_per_basket = 24 baskets = apples // apples_per_basket result = baskets return result
Jake has a monthly salary of $5000. He needs to pay 25% of this amount as rent and save 20% of the remaining amount. How much money will he have left after he pays rent and saves money?
def solve() -> int: salary = 5000 rent = salary * 0.25 remaining = salary - rent savings = remaining * 0.2 result = remaining - savings return result
Tom is going on a banana diet. He needs 5 bananas for breakfast, 4 for lunch and 3 for dinner, every day. How many bananas does he need for 3 days?
def solve() -> int: totalBananas = 0 for day in range(3): totalBananas = totalBananas + (5 + 4 + 3) result = totalBananas return result
A party supplies store has 10 packs of confetti. Each pack has 50 pieces of confetti. If 9 customers buy 3 packs each, how many pieces of confetti were sold in total?
def solve() -> int: packs_of_confetti = 10 pieces_per_pack = 50 customers = 9 packs_per_customer = 3 total_packs_sold = customers * packs_per_customer total_pieces_sold = total_packs_sold * pieces_per_pack result = total_pieces_sold return result
In a bag of marbles, the number of blue marbles is 4 less than twice the number of red marbles. If there are 7 red marbles, how many blue marbles are there?
def solve() -> int: red_marbles = 7 blue_marbles = 2 * red_marbles - 4 result = blue_marbles return result
A student scores 90 on their first test, 80 on their second test, and 95 on their third test. If each test is worth 100 total points, what is their average score?
def solve() -> int: test1_score = 90 test2_score = 80 test3_score = 95 total_points = 100 * 3 total_score = test1_score + test2_score + test3_score average_score = total_score / 3 result = average_score return result
If Sarah saves $5 every day, how much will she have saved in 6 months?
def solve() -> int: dollars_per_day = 5 days_per_month = 30 months = 6 total_savings = dollars_per_day * days_per_month * months result = total_savings return result
Michael has 200 crayons in his box. 25% of them are yellow. 30% are green, and the rest are different colors. If his little sister wants to borrow five crayons, how many crayons of other colors she will get, on average?
def solve() -> int: total_crayons = 200 yellow_crayons = total_crayons * 0.25 green_crayons = total_crayons * 0.30 other_crayons = total_crayons - yellow_crayons - green_crayons average_other_crayons = other_crayons / (total_crayons - 5) result = average_other_crayons return result
In a bakery, a chef can bake 24 cookies per minute. If the chef needs to bake a total of 1000 cookies, how long would it take in minutes to bake all the cookies?
def solve() -> int: total_cookies = 1000 cookies_per_minute = 24 time = total_cookies / cookies_per_minute result = time return result
Maya won $75 in a scratch-off lottery. She decided to use the money to pay off some bills. She paid $15 towards her credit card, then paid four times as much to her phone bill as she did to her credit card. Finally, she paid half as much to her utilities bill as she did to her phone bill. How much money does she have l...
def solve() -> int: lottery_winnings = 75 credit_card_payment = 15 phone_bill_payment = credit_card_payment * 4 utilities_bill_payment = phone_bill_payment / 2 total_bills_paid = credit_card_payment + phone_bill_payment + utilities_bill_payment money_left = lottery_winnings - total_bills_paid ...
Zoe had 231 candies. She bought 510 more candies and shared 369 candies with her friends. How many candies does Zoe have now?
def solve() -> int: candies_initial = 231 candies_bought = 510 candies_shared = 369 candies_total = candies_initial + candies_bought - candies_shared result = candies_total return result
In Desert National Park, there are double as many camels as lions, and triple as many scorpions as camels. If there are 10 more spiders than scorpions, how many animals in total does Desert National Park have?
def solve() -> int: # Python program to solve question 7 lions = 100 camels = lions * 2 scorpions = camels * 3 spiders = scorpions + 10 total_animals = lions + camels + scorpions + spiders result = total_animals return result
Mia has 18 apples. Liam has 5 more apples than Mia. Ethan has triple the number of apples as Mia. How many apples do they have altogether?
def solve() -> int: # Python program to solve the problem mia_apples = 18 liam_apples = mia_apples + 5 ethan_apples = 3 * mia_apples total_apples = mia_apples + liam_apples + ethan_apples result = total_apples return result
At the beach, Tom noticed a group of 9 surfers coming out of the water. If there were also 18 people sunbathing on the sand, how many people are at the beach?
def solve() -> int: surfers = 9 sunbathers = 18 total_people = surfers + sunbathers result = total_people return result
Sara is buying sandwiches for her family. Her son likes turkey sandwiches, while her daughter likes ham sandwiches. Sara and her husband want to share a veggie sandwich. Sandwiches cost $5.00 each and toppings are $1.00 each. Sara tips $4.00. What is the total cost of the sandwich order?
def solve() -> int: turkey_sandwiches = 1 ham_sandwiches = 1 veggie_sandwiches = 1 toppings_per_sandwich = 2 sandwich_cost = 5 tip = 4 total_cost = (turkey_sandwiches + ham_sandwiches + veggie_sandwiches) * (sandwich_cost + toppings_per_sandwich) + tip result = total_cost ...
A bookstore has 400 books on sale. If 50% of the books are fiction, how many non-fiction books are available for sale?
def solve() -> int: total_books = 400 fiction_books = total_books * 0.50 nonfiction_books = total_books - fiction_books result = nonfiction_books return result
Mike went on a shopping spree for clothes. He bought 3 t-shirts for $20 each and double the number of pairs of jeans which cost $50 each. How much did he spend?
def solve() -> int: # Number of t-shirts bought t_shirts = 3 # Cost per t-shirt t_shirt_cost = 20.00 # Number of pairs of jeans bought jeans = 2 * t_shirts # Cost per pair of jeans jeans_cost = 50.00 # Total cost total_cost = t_shirts * t_shirt_cost + jeans * jeans_cost resul...
Tim read 20 more books this year than he read last year, which is 5 times as many as he read last year. If Tim read 4 books last year, how many books did he read in total this year?
def solve() -> int: books_last_year = 4 books_this_year = 5 * books_last_year + 20 total_books = books_last_year + books_this_year result = total_books return result
A hospital purchased 3000 doses of medicine for its patients. However, only 100 patients require the medicine and each patient is prescribed 20 doses. How many doses of medicine will remain unused?
def solve() -> int: num_doses = 3000 num_patients = 100 doses_per_patient = 20 total_doses_needed = num_patients * doses_per_patient unused_doses = num_doses - total_doses_needed result = unused_doses return result
Daniel has 180 marbles. One-third of the marbles are glass and the rest are plastic. He then shares the glass marbles equally among his friends such that each friend receives 10 marbles. He then shares the plastic marbles equally among his siblings such that each sibling receives 6 marbles. How many friends and sibling...
def solve() -> int: marbles = 180 friends = (1/3) * marbles / 10 siblings = (2/3) * marbles / 6 total_given = friends + siblings result = total_given return result
Jack has three times the number of marbles as Joe. Jill has half the number of marbles that Joe has. If Joe has 24 marbles, how many marbles do Jack and Jill have together?
def solve() -> int: joe_marbles = 24 jack_marbles = 3*joe_marbles jill_marbles = 0.5*joe_marbles total_marbles = jack_marbles + jill_marbles result = total_marbles return result
A city has twice as many cars as motorcycles. If there are 100 motorcycles in the city, how many total cars and motorcycles are there?
def solve() -> int: motorcycles = 100 cars = motorcycles * 2 total = motorcycles + cars result = total return result
In a zoo, there are 3 identical enclosures. Each enclosure has 5 tigers, 8 lions, and 15 monkeys. If the zoo has 60% of its maximum capacity, how many animals live in the zoo?
def solve() -> int: # Step 1: Calculate the maximum capacity of the zoo by finding the total number of animals in one enclosure # Step 2: Multiply the maximum capacity by the number of enclosures to get the total number of animals in the zoo # Step 3: Calculate 60% of the total number of animals to find the...
A train covers a distance of 1500 km in 30 hours. What is the average speed of the train?
def solve() -> int: distance = 1500 time = 30 speed = distance / time result = speed return result
A car travels at a speed of 60 km/h. How far will it travel in 2.5 hours?
def solve() -> int: speed = 60 # km/h time = 2.5 # hours distance = speed * time result = distance return result
Jack and Jill have a combined age of 50 years. Jack is thrice as old as Jill was when Jack was half as old as Jill would be when Jill was three times as old as Jack's age. How old is Jack?
def solve() -> int: total_age = 50 jill_age = 18 jack_age = total_age - jill_age result = jack_age return result
Student: A school has a budget with $1000. They want to spend $500 for books and $150 for paper. How much budget is left after they spend for the books and the paper?
def solve() -> int: budget = 1000 books = 500 paper = 150 remaining_budget = budget - books - paper result = remaining_budget return result
Result: 200 A store is selling T-shirts at a discount. The original price of a T-shirt was $12, but it is now on sale for $9. If Anna buys 3 T-shirts, how much money does she save?
def solve() -> int: original_price = 12 sale_price = 9 discount = original_price - sale_price savings = discount * 3 result = savings return result
Jackie works as a delivery driver that receives a flat rate of $10 per delivery and an additional tip. If he delivers 12 packages on Monday, his total earnings are $178. What was the average tip received per delivery?
def solve() -> int: packages_monday = 12 earnings_monday = 178 flat_rate = 10 tip = (earnings_monday - (packages_monday * flat_rate)) / packages_monday result = tip return result
A group of 8 students each scored 80 on their math test. Four of the students also scored 90 on their science test. What is the total score of the class?
def solve() -> int: math_score = 8 * 80 science_score = 4 * 90 total_score = math_score + science_score result = total_score return result
If Lucy runs 6 miles a day for 5 days a week, how many miles will she run in 3 weeks?
def solve() -> int: distance_per_day = 6 days_per_week = 5 weeks = 3 total_distance = distance_per_day * days_per_week * weeks result = total_distance return result
A hiking trail is 15 miles long. Sarah hiked 40% of the trail before she had to turn back. How many miles did she hike?
def solve() -> int: total_distance = 15 hiked_distance = total_distance * 0.40 result = hiked_distance return result
A hawker sells pears and apples. He has 200 pears and 300 apples. He packs 10 pears and 12 apples together into one box. How many boxes can he fill up with these fruits?
def solve() -> int: total_fruits = 200 + 300 boxes = total_fruits // (10 + 12) result = boxes return result
John bought a laptop for $600. The laptop had a discount of 20% off. What is the original price of the laptop?
def solve() -> int: # Given values final_price = 600 discount_percentage = 0.20 # Calculation original_price = final_price / (1 - discount_percentage) result = original_price return result
2. Laura drove from her house to the train station 82 miles away at a speed of 40 mph. The train journey took her 1 hour and she travelled back in her car for a further 73 miles at a speed of 48 mph. How long did she spend away from home?
def solve() -> int: total_distance = 82 + 73 average_speed = (40 + 48) / 2 total_time = total_distance / average_speed result = total_time / 60 return result
A jar is filled with 80 jellybeans. If Sam takes 12 jellybeans out, how many are left in the jar?
def solve() -> int: total_jellybeans = 80 jellybeans_taken = 12 jellybeans_left = total_jellybeans - jellybeans_taken result = jellybeans_left return result
The length of a rectangle is twice its width. If the perimeter of the rectangle is 24 cm, what is the length of the rectangle?
def solve() -> int: perimeter = 24 width = perimeter // 6 length = width * 2 result = length return result
A movie theater charges adults $12 per ticket and children $8 per ticket. If a family of 4 consisting of 2 adults and 2 children goes to the theater, how much will it cost them?
def solve() -> int: adult_ticket_price = 12 child_ticket_price = 8 num_of_adults = 2 num_of_children = 2 total_cost = (num_of_adults * adult_ticket_price) + (num_of_children * child_ticket_price) result = total_cost return result
Lisa has twice as many marbles as Peter. Peter has 15 marbles. Lisa gives Peter 10 marbles. Now they have the same number of marbles. How many marbles did Lisa start with?
def solve() -> int: peterMarbles = 15 lisaMarbles = peterMarbles * 2 lisaMarbles -= 10 result = lisaMarbles return result
A bookstore has 50 books on the shelves and 30 more books in the storage. If the store has sold 15 books on the shelves, how many books are left in the store?
def solve() -> int: books_on_shelves = 50 books_in_storage = 30 books_sold_on_shelves = 15 total_books = books_on_shelves + books_in_storage books_left = total_books - books_sold_on_shelves result = books_left return result
A toy store has 2 aisles, each containing 5 shelves. If a child can carry 3 toys at once, how many toys can the child carry in 4 trips?
def solve() -> int: total_toys = 2 * 5 toys_per_trip = 3 toys_carried = toys_per_trip * 4 result = toys_carried return result
A library has 60 fiction books and 45 non-fiction books. If 20 fiction books and 15 non-fiction books are borrowed, how many fiction and non-fiction books are left in the library?
def solve() -> int: fiction_books = 60 nonfiction_books = 45 borrowed_fiction = 20 borrowed_nonfiction = 15 remaining_fiction = fiction_books - borrowed_fiction remaining_nonfiction = nonfiction_books - borrowed_nonfiction result = remaining_fiction + remaining_nonfiction return result
Student: 1. How many meters of fencing material will be needed to build a boundary fence for a rectangular playground with length 20 meters and width 15 meters?
def solve() -> int: length = 20 width = 15 perimeter = 2 * (length + width) result = perimeter return result
Mary bought 3 bags of chips, and each bag contained 20 chips. Each chip cost $0.25. If her friend pays for half, how much did Mary pay?
def solve() -> int: bags_of_chips = 3 chips_per_bag = 20 chip_cost = 0.25 total_chips = bags_of_chips * chips_per_bag mary_share = total_chips * chip_cost / 2 result = mary_share return result
Daniel has $50 in his wallet. He spends $18 on groceries and $12 on a movie ticket. After buying the groceries and movie ticket, Daniel receives $15 as a gift from his aunt. How much money does Daniel have now?
def solve() -> int: money = 50 money -= 18 money -= 12 money += 15 result = money return result
A car travels at a speed of 60 miles per hour. If the car travels for 4 hours, how far will it have gone?
def solve() -> int: speed = 60 time = 4 distance = speed * time result = distance return result
Mike sold all the remaining shoes from his store before closing. He reduced the price of his $70 sneakers and $50 sandals by 25%. If he sold the last 20 sneakers and 30 sandals, how much money did he make?
def solve() -> int: sneaker_price = 70 sandals_price = 50 sneaker_discount = 0.25 sandals_discount = 0.25 sneaker_discounted_price = sneaker_price - (sneaker_price * sneaker_discount) sandals_discounted_price = sandals_price - (sandals_price * sandals_discount) sneaker_sold = ...
Student: Stella sold 40 bracelets for $12 each and 30 necklaces for $15 each at a craft fair. She spent $200 on the materials and $50 on the booth rental. She also bought 10 earrings for $10 each from another seller at the fair. If she had $100 in her wallet and adds the money she earned from the sales to her wallet, c...
def solve() -> int: bracelets = 40 bracelet_price = 12 necklaces = 30 necklace_price = 15 materials_cost = 200 booth_rental = 50 earrings = 10 earring_price = 10 bracelet_revenue = bracelets * bracelet_price necklace_revenue = necklaces * necklace_price earring_cost = earring...
Sarah's monthly rent is $1500. She works as a part-time barista and makes $10 per hour. If she works 5 hours every weekday and 7 hours on a Saturday, how many weeks will it take for her to earn enough to cover her rent?
def solve() -> int: rent = 1500 hourly_wage = 10 weekday_hours = 5 saturday_hours = 7 weekly_hours = (weekday_hours * 5) + saturday_hours weekly_earnings = weekly_hours * hourly_wage weeks_needed = rent / weekly_earnings result = weeks_needed return result
Jason is buying juice at the grocery store. He can buy 1 bottle of juice for $2.50 that contains 125 calories. He could also buy a 6-pack of juice bottles, with each bottle being 100 calories, for $12. Which option gives him more calories per dollar?
def solve() -> int: calories_per_dollar_individual = 125 / 2.5 calories_per_dollar_pack = (6 * 100) / 12 calories_per_dollar_difference = calories_per_dollar_pack - calories_per_dollar_individual result = calories_per_dollar_difference return result
At a car dealership, four-fifths of the red cars have a scratch. One-third of the black cars also have a scratch. If there are 60 red cars and 30 black cars at the dealership, how many cars have scratches on them?
def solve() -> int: red_cars = 60 black_cars = 30 red_scratch = 4/5 * red_cars black_scratch = 1/3 * black_cars total_scratch = red_scratch + black_scratch result = total_scratch return result
Tom has been running for the past 7 years. He runs 15 miles every two weeks. How many miles has Tom run in total?
def solve() -> int: years = 7 miles_per_week = 15 / 2 total_miles = years * 52 * miles_per_week result = total_miles return result
End of preview. Expand in Data Studio

tinysms train qa

The training questions with their reference programs, preprocessed exactly as the model is trained on them: the docstring repeating the question is stripped and the entry point is renamed to solve. Only the pairs whose reference program returns a finite number are kept, so the row set is the one the project trains on -- the answers themselves are not shipped.

Loading

from datasets import load_dataset
ds = load_dataset("SlavaYus/tinysms_train_qa", split="train")

Schema

question: string
code: string
| column | what |
|---|---|
| `question` | the math word problem, stripped |
| `code` | reference program, docstring removed, entry point renamed to `solve` -- the completion target |

Provenance

  • source: TinyGSM/TinyGSM, revision 5049a7840fa546985eaae4c698d5daf6fdf7b47d
  • rows: /tmp/opencode/tinysms_data8/train_pool.jsonl (the raw pool of src/data.py, --pool-size), first 1000000 of them in file order
  • splits follow src/data.py: validation and test are the tail of shard 0, train is the head of shard 0 followed by the following shards, so train, validation and test are disjoint
  • gold answers: the reference program is executed in a sandbox (src/sandbox.py); pairs whose reference does not return a number were dropped (13866 here, 1 of them an integer too large for float64, which the pass@1 comparator could not handle either)
  • a reference program that kills the sandbox worker takes its whole 64-program batch down with it; for train those batches were re-run one program at a time, the test split keeps the project's own batching so that it stays identical to the evaluation set
  • preprocessing is the model's own (src/tokenizer.py): docstring stripped, simple_math_problem renamed to solve, rendered with format_example

Build

386134 rows in 2 parquet file(s), folder out/hf_datasets/tinysms_train_qa/, built by

python -m scripts.build_hf_datasets --n-train 1000000 --n-val 2000 --n-test 2000 --train-pool /tmp/opencode/tinysms_data8/train_pool.jsonl --out out/hf_datasets --namespace SlavaYus --repo-suffix 

meta.json next to this file holds the full build parameters.

Downloads last month
8