messages
listlengths
2
2
category
stringclasses
3 values
source
stringclasses
6 values
[ { "content": "Jillian, Savannah, and Clayton were collecting shells on the beach. They collected 29, 17, and 8 shells respectively. They decided that they wanted to give the shells to some of their friends who had just arrived. They put their shells together and distributed them evenly to each friend. Each frie...
math
microsoft/orca-math-word-problems-200k
[ { "content": "Write code to find the smallest number in an array of numbers.\narr = [5, 8, 2, 4, 7, 10]", "role": "user" }, { "content": "def find_smallest_number(arr):\n \"\"\"\n Finds the smallest number in an array of numbers.\n \"\"\"\n min_num = arr[0]\n for num in arr[1:]:\n ...
code
sahil2801/CodeAlpaca-20k
[ { "content": "Pablo likes to put together jigsaw puzzles. He can put together an average of 100 pieces per hour. He has eight puzzles with 300 pieces each and five puzzles with 500 pieces each. If Pablo only works on puzzles for a maximum of 7 hours each day, how many days will it take him to complete all of hi...
math
openai/gsm8k
[ { "content": "A dog is being treated for fleas. One flea treatment gets rid of half the fleas. After four treatments, the dog has 14 fleas left. How many more fleas did the dog have before the flea treatments than after?", "role": "user" }, { "content": "After three treatments, the dog had 14 * 2 = ...
math
openai/gsm8k
[ { "content": "Adam bought 3 kilograms of nuts and x kilograms of dried fruits at a store. One kilogram of nuts costs $12 and one kilogram of dried fruit costs $8. His purchases cost 56. What is the value of unknown variable x?", "role": "user" }, { "content": "To solve this problem, we need to deter...
math
meta-math/MetaMathQA
[ { "content": "Write a Python method to find the area of a triangle using Heron's formula.\nThe sides of the triangle are 6, 8 and 10", "role": "user" }, { "content": "import math\n\ndef heron(a, b, c):\n s = (a + b + c) / 2\n area = math.sqrt(s * (s - a) * (s - b) * (s - c))\n return area\n...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Generate a program in Python to find the day of the week for any given date.", "role": "user" }, { "content": "# Getting date from user\ndate_string = input('Enter date in (dd/mm/yyyy) format: ')\n \n# Split date using '/' as delimeter\ndate_list = date_string.split('/')\n \n# Convert ...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Phyllis has two gardens. In the first garden, she has 20 plants and 10% are tomato plants. In the second garden, she has 15 plants and 1/3 of these plants are tomato plants. What percentage of all the plants in her two gardens are tomato plants?", "role": "user" }, { "content": "In the...
math
meta-math/MetaMathQA
[ { "content": "Dakota and Ben purchased eggs for $3, pancakes for $2, and 2 mugs of cocoa for $2 each, with an additional $1 for tax. Later, Ben decides to order 1 more batch of pancakes and 1 more mug of cocoa. If they paid with $15, how much change should they receive?", "role": "user" }, { "conten...
math
meta-math/MetaMathQA
[ { "content": "Carla spends 10 minutes sharpening her knife and x times that amount of time peeling vegetables. How much time does she spend on these activities total?\nIf we know the answer to the above question is 40, what is the value of unknown variable x?", "role": "user" }, { "content": "Carla ...
math
meta-math/MetaMathQA
[ { "content": "Drop all duplicates from a NumPy array.\narr = [10, 20, 30, 10, 30, 20]", "role": "user" }, { "content": "import numpy as np\n\ndef drop_duplicates(arr):\n return np.unique(arr)", "role": "assistant" } ]
code
sahil2801/CodeAlpaca-20k
[ { "content": "Create a Python program to round up a float to the nearest integer.\n3.14", "role": "user" }, { "content": "def round_up(f):\n if f - int(f) >= 0.5:\n return int(f) + 1\n return int(f)\n\nround_val = round_up(3.14)\nprint(round_val)", "role": "assistant" } ]
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Vincent's bookstore is divided into different kinds of books. His top-selling books are fantasy books. He also sells literature books which cost half of the price of a fantasy book. If his fantasy books cost $4 each, and he sold five fantasy books and eight literature books per day, how much money...
math
meta-math/MetaMathQA
[ { "content": "Betty is growing parsnips in her vegetable garden. When the parsnips are grown, they are harvested and bundled into boxes that can hold up to 20 parsnips each. Each harvest, three-quarters of the boxes are full, and the remaining boxes are half-full. She gets an average of 20 boxes each harvest. H...
math
openai/gsm8k
[ { "content": "James collects all the fruits from his 2 trees. Each tree has 20 plants. Each plant has 1 seed and he plants 60% of those. How many trees did he plant?", "role": "user" }, { "content": "He got 20*2=<<20*2=40>>40 seeds\nThat means he plants 40*.6=<<40*.6=24>>24 trees\n#### 24", "...
math
openai/gsm8k
[ { "content": "Jake has some money. He spends $2800 on a new motorcycle, and then spends half of what's left on a concert ticket. Jake then loses a fourth of what he has left. He has $825 left. How much money did Jake initially have?", "role": "user" }, { "content": "Let's call the amount of money Ja...
math
microsoft/orca-math-word-problems-200k
[ { "content": "Among 5, 8, 9, and 7, which is the largest number?", "role": "user" }, { "content": "The largest number among 5, 8, 9, and 7 is 9.", "role": "assistant" } ]
math
microsoft/orca-math-word-problems-200k
[ { "content": "Build a function to identify a duplicate element in a list\nlist = [2,4,8,7,2,5]", "role": "user" }, { "content": "def find_duplicate(list):\n\tvisited = set()\n\tfor num in list:\n\t\tif num in visited:\n\t\t\treturn num\n\t\telse:\n\t\t\tvisited.add(num)\n\treturn None\n\nlist = [2,4...
code
sahil2801/CodeAlpaca-20k
[ { "content": "Bucky earns money each weekend catching and selling fish. He wants to save up for a new video game, which costs $60. Last weekend he earned $35. He can earn $5 from trout and $4 from blue-gill. He caught five fish this Sunday. If 60% were trout, and the rest were blue-gill, how much more does he n...
math
microsoft/orca-math-word-problems-200k
[ { "content": "Eugene built a model house out of toothpicks and a deck of playing cards. For every card, he used 75 toothpicks. The deck of playing cards had 52 cards, and Eugene used all but a certain number of the cards to build his house. He used 6 boxes of toothpicks, each containing 450 toothpicks, to creat...
math
microsoft/orca-math-word-problems-200k
[ { "content": "Tom finds 10 quarters, 3 dimes, and 4 nickels and 200 pennies. In dollars, how much money did he find?", "role": "user" }, { "content": "He found 10*.25=$<<10*.25=2.5>>2.5 in quarters\nHe found 3*.1=$<<3*.1=.3>>.3 in dimes\nHe found 4*.05=$<<4*.05=.2>>.2 in nickels\nHe found 200*.01=$<...
math
openai/gsm8k
[ { "content": "Write a queries for finding the second highest salary of an employee in Employee table.", "role": "user" }, { "content": "SELECT MAX(Salary) \nFROM Employee \nWHERE Salary < (SELECT MAX(Salary) FROM Employee);", "role": "assistant" } ]
code
sahil2801/CodeAlpaca-20k
[ { "content": "A TV show costs $100,000 per episode for the first season and twice that much for every other season. The first season had 12 episodes, and every season after that had 50% more episodes except the last season, which had 24 episodes. The show had 5 seasons. How much did it cost to produce all th...
math
openai/gsm8k
[ { "content": "Loisa wants to buy a tablet that costs $450 cash. Since she does not have enough money, the store offered her an installment plan for 12 months. She will pay $100 as a down payment and pay $40 for the first 4 months; then $35 for the next four months; then $30 for the last four months. How much wi...
math
meta-math/MetaMathQA
[ { "content": "Juvy has a garden that has 20 rows with x plants in each row. She plants parsley in the first 3 rows and rosemary in the last two rows. The rest of the rows will be planted with chives. How many chives will Juvy plant?\nIf we know the answer to the above question is 150, what is the value of unkno...
math
meta-math/MetaMathQA
[ { "content": "Explain the main arguments on both sides of a current controversy.\nGun control laws", "role": "user" }, { "content": "The gun control debate has been going on for decades, and there are two main camps to the argument. Those in favor of gun control argue that guns are too often used fo...
instruction
tatsu-lab/alpaca
[ { "content": "How many three-digit numbers less than 300 satisfiy the following condition that the sum of each digit needs to be 7?", "role": "user" }, { "content": "To find the three-digit numbers less than 300 whose digits sum to 7, we need to consider numbers in the range of 100 to 299.\n\nLet's ...
math
microsoft/orca-math-word-problems-200k
[ { "content": "Jack bought 55 apples. He wants to give 10 to his father and then equally share the remaining apples between him and his 4 friends. How many apples will each of them get?", "role": "user" }, { "content": "First, Jack gives 10 apples to his father, so he has 55 - 10 = 45 apples left.\n\...
math
microsoft/orca-math-word-problems-200k
[ { "content": "What three-digit number with units digit X and hundreds digit 4 is divisible by 9? The answer is 432. What is the value of unknown variable X?", "role": "user" }, { "content": "ble x is 2.\nThe answer is: 2", "role": "assistant" } ]
math
meta-math/MetaMathQA
[ { "content": "Implement a JavaScript function to find all distinct prime factors of a given number.", "role": "user" }, { "content": "function findPrimeFactors(num) { \n let factors = []; \n while (num % 2 === 0) { \n factors.push(2); \n num = num / 2; \n } \n \n // num mu...
code
sahil2801/CodeAlpaca-20k
[ { "content": "Janet makes 50 snowballs and her brother makes 150 snowballs. What percentage of the snowballs did Janet make?", "role": "user" }, { "content": "The total number of snowballs made is 50 + 150 = 200\nJanet made 50 snowballs, so the percentage of snowballs she made is 50/200 * 100 = 25%\...
math
meta-math/MetaMathQA
[ { "content": "On a weekend road trip, the Jensen family drove 210 miles on highways, where their car gets 35 miles for each gallon of gas and 54 miles on city streets where their car gets x miles for each gallon. How many gallons of gas did they use?\nIf we know the answer to the above question is 9, what is th...
math
meta-math/MetaMathQA
[ { "content": "Dan spent $32 buying a new backpack, 1 pack of pens, 1 pack of pencils and 5 multi-subject notebooks for school. If the backpack costs $15 and both the pens and pencils cost $1.00 each, how much did each notebook cost?", "role": "user" }, { "content": "The pens and pencils were $1.00 ...
math
openai/gsm8k
[ { "content": "Cynthia has three children whose ages add up to 35. Matthew is two years older than Rebecca and four years younger than Freddy. How many years old is Freddy?", "role": "user" }, { "content": "Let A be Matthew’s age.\nRebecca is A - 2 years old.\nFreddy is A + 4 years old.\nTheir ages a...
math
openai/gsm8k
[ { "content": "Translate the following sentence into Spanish.\nThe blue sky is so beautiful.", "role": "user" }, { "content": "El cielo azul es tan hermoso.", "role": "assistant" } ]
instruction
tatsu-lab/alpaca
[ { "content": "Get the sum of the first 100 even numbers.", "role": "user" }, { "content": "The sum of the first 100 even numbers is 10,200.", "role": "assistant" } ]
code
sahil2801/CodeAlpaca-20k
[ { "content": "The area of a triangle is 600 square feet. Find the altitude, in feet, of the triangle if the length of the corresponding base is X feet.\nIf we know the answer to the above question is 40, what is the value of unknown variable X?", "role": "user" }, { "content": "We are given that the...
math
meta-math/MetaMathQA
[ { "content": "Create a Python program to encrypt a message with an XOR encryption algorithm.\nsecretmessage", "role": "user" }, { "content": "def xor_encrypt(message, key):\n encrypted = \"\"\n for i in range(len(message)):\n encrypted += chr(ord(message[i]) ^ ord(key[i % len(key)]))\n return encry...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Create an natural language processing application in Python that extracts the top 10 most frequent words from a given text.\nLorem ipsum dolor sit amet, consectetur adipiscing elit, \nsed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", "role": "user" }, { "content": "f...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Develop a function to convert a string to an integer in Python.", "role": "user" }, { "content": "def str_to_int(input_str):\n num = 0\n for char in input_str:\n num = num * 10 + ord(char) - ord('0')\n return num", "role": "assistant" } ]
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Write a Python program to get the maximum and minimum value in a dictionary.\ndata = {'John': 24, 'Adam': 45, 'Kate': 12}", "role": "user" }, { "content": "data = {'John': 24, 'Adam': 45, 'Kate': 12}\n\ndef get_max_min(data):\n \"\"\"This function will return the maximum and minimum...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Summarize the following 3 paragraphs\nThe use of electric vehicles (EVs) has grown significantly in recent years as a result of technological advancements. Consumers are becoming more aware of the environmental and economic benefits of owning an EV, leading to an increase in the number of EVs sold...
instruction
tatsu-lab/alpaca
[ { "content": "Compute the minimum score required to pass a test with 15 questions and a passing score of 80%.", "role": "user" }, { "content": "The minimum score required to pass the test is 12 out of 15, which is equivalent to 80%.", "role": "assistant" } ]
instruction
tatsu-lab/alpaca
[ { "content": "The Ravenswood forest has four times as many gnomes as the Westerville woods. If there are x gnomes in Westerville woods, 48 gnomes would remain in Ravenswood forest if 40% of the gnomes are taken for use by the forest owner. What is the value of unknown variable x? What is the value of unknown va...
math
meta-math/MetaMathQA
[ { "content": "Delete the redundant words in the following sentence:\nI went to the store for for groceries.", "role": "user" }, { "content": "I went to the store for groceries.", "role": "assistant" } ]
instruction
tatsu-lab/alpaca
[ { "content": "Mia has 4 times as many shells as David. Ava has 20 more shells than Mia. Alice has half the number of shells Ava has. If the total number of conch shells they all have is 195, how many shells does David have?", "role": "user" }, { "content": "Let's denote the number of shells David ha...
math
microsoft/orca-math-word-problems-200k
[ { "content": "Lanie has been sick and was only able to work 4/5 of her usual 40-hour week. If her hourly rate is $15, how much was her salary for that week?", "role": "user" }, { "content": "Lanie was only able to work 4/5 of her usual 40-hour week, so she worked 4/5 * 40 = 32 hours.\nHer hourly rat...
math
meta-math/MetaMathQA
[ { "content": "Calculate the union of two given sets in Java.\nSet 1: {1, 2, 3}\nSet 2 : {3, 4, 5}", "role": "user" }, { "content": "Set<Integer> set1 = new HashSet<>();\nset1.add(1);\nset1.add(2);\nset1.add(3);\n\nSet<Integer> set2 = new HashSet<>();\nset2.add(3);\nset2.add(4);\nset2.add(5);\n\nSet<...
code
sahil2801/CodeAlpaca-20k
[ { "content": "Come up with a python code to find the mean of a list of numbers.\nnums = [78, 79, 79, 79, 79, 80]", "role": "user" }, { "content": "total = 0\nfor num in nums:\n total += num\nmean = total/len(nums)\nprint(mean)", "role": "assistant" } ]
code
sahil2801/CodeAlpaca-20k
[ { "content": "Determine the domain of the function $g(x) = \\frac{3x+1}{x+8}$. Express your answer using interval notation.", "role": "user" }, { "content": "The function $g(x)$ is defined as long as the denominator $x+8$ is not equal to zero.\nTherefore, the domain of $g(x)$ is all real numbers exc...
math
meta-math/MetaMathQA
[ { "content": "With her savings, Sara bought two books: a book for 5.5£ and a book for 6.5£. She gives a 20£ bill to the seller. How much change does she get back?", "role": "user" }, { "content": "The total cost of the books is 5.5£ + 6.5£ = 12£.\nSara gave the seller a 20£ bill, so the change she s...
math
meta-math/MetaMathQA
[ { "content": "To get free delivery, Alice needs to spend a minimum of $35.00 online at her favorite grocery store. In her cart she has 1.5 pounds of chicken at $6.00 per pound, 1 pack of lettuce for $3.00, cherry tomatoes for $2.50, 4 sweet potatoes at $0.75 each, 2 heads of broccoli for $2.00 each and a pound...
math
openai/gsm8k
[ { "content": "Determine which of these options is the correct answer\nWhich of these countries has the most volcanoes?\n(A) Italy\n(B) Japan\n(C) Germany\n(D) Mexico", "role": "user" }, { "content": "B. Japan has the most volcanoes.", "role": "assistant" } ]
instruction
tatsu-lab/alpaca
[ { "content": "Provide a Python program that takes a number as input, and calculates the factorial of that number.\n5", "role": "user" }, { "content": "def factorial(num):\n if num == 0:\n return 1\n else:\n return num * factorial(num-1)\n \nnum = int(input(\"Enter a number:\"))\n...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Susie has 572 beans in the jar. One-fourth of them are red and one-third of the remaining beans are white. Then half of the remaining are green beans. How many green beans are there?", "role": "user" }, { "content": "One-fourth of the beans are red, so there are 572/4 = 143 red beans.\...
math
meta-math/MetaMathQA
[ { "content": "How many positive three-digit integers less than 500 have at least two digits that are the same?", "role": "user" }, { "content": "We can count the number of three-digit integers that have no repeating digits and subtract that from the total number of three-digit integers less than 500...
math
meta-math/MetaMathQA
[ { "content": "What was the speed limit if Natasha was traveling 10 mph over the speed limit and it took her one hour to reach her destination, which was 60 miles away?", "role": "user" }, { "content": "If Natasha was traveling 10 mph over the speed limit, and it took her one hour to reach her destin...
math
meta-math/MetaMathQA
[ { "content": "Jean has 60 stuffies. She keeps 1/3 of them and then gives away the rest. She gives 1/4 of what she gave away to her sister Janet. How many stuffies did Janet get?", "role": "user" }, { "content": "Jean kept 60/3=<<60/3=20>>20 stuffies\nThat means she gave away 60-20=<<60-20=40>>40 ...
math
openai/gsm8k
[ { "content": "Mary had some stickers. She used 3 large stickers on the front page of her journal and 7 stickers each to 6 other pages of her journal. Now, Mary has 44 stickers remaining. How many stickers did Mary initially have?", "role": "user" }, { "content": "Mary used 3 large stickers on the fr...
math
microsoft/orca-math-word-problems-200k
[ { "content": "A certain tree was 100 meters tall at the end of 2017. It will grow 10% more than its previous height each year. How long has the tree grown from 2017 until the end of 2019?", "role": "user" }, { "content": "At the end of 2018, the tree will grow 100 x 10/100 = <<100*10/100=10>>10 mete...
math
openai/gsm8k
[ { "content": "Create a REST API endpoint in Python that returns the user with the highest score.", "role": "user" }, { "content": "@app.route(\"/get_top_user\", methods=[\"GET\"])\ndef get_top_user():\n user_list = Users.query.order_by(desc(Users.score)).first()\n return jsonify(user_list.seri...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "In a truck, there are 26 pink hard hats, 15 green hard hats, and 24 yellow hard hats. Carl takes away 4 pink hard hats, and John takes away some pink hard hats and twice as many green hard hats as the number of pink hard hats that he removed. The total number of hard hats that remained in the truc...
math
microsoft/orca-math-word-problems-200k
[ { "content": "Tim has 30 less apples than Martha, and Harry has half as many apples as Tim. If Martha has 68 apples, how many apples does Harry have?", "role": "user" }, { "content": "Tim has 68-30 = <<68-30=38>>38 apples.\nHarry has 38/2 = <<38/2=19>>19 apples.\n#### 19", "role": "assistant" ...
math
openai/gsm8k
[ { "content": "Create a Python script to scrape the HTML of a website and extract information from it.\nurl = 'http://www.example.com'", "role": "user" }, { "content": "import requests\nfrom bs4 import BeautifulSoup\n\n# Fetch page\npage = requests.get(url)\n\n# Parse HTML into BeautifulSoup object\n...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Sam invested $10,000 and earned 20% interest compounded for 3 years. He then invested more until he had three times as much invested. The next year, he got a 15% return on his investment. How much money does Sam have now?", "role": "user" }, { "content": "First, let's calculate the amo...
math
microsoft/orca-math-word-problems-200k
[ { "content": "There are 3 red clothes and 7 yellow clothes in the closet. How many clothes can you wear?", "role": "user" }, { "content": "Assuming all the clothes in the closet are wearable and fit you, you can wear a total of 10 clothes (3 red + 7 yellow).", "role": "assistant" } ]
math
microsoft/orca-math-word-problems-200k
[ { "content": "Create a Python program to retrieve the longest string from an array of strings\nnames = ['John', 'Paul', 'George', 'Ringo']", "role": "user" }, { "content": "def get_longest_string(names):\n longest_string = ''\n for name in names:\n if len(name) > len(longest_string):\n ...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "A parking area near Peter's house is 4 stories tall. There are some open parking spots on the first level. There are 7 more open parking spots on the second level than on the first level, and there are 6 more open parking spots on the third level than on the second level. There are 14 open parking...
math
microsoft/orca-math-word-problems-200k
[ { "content": "How many natural numbers from 1 to 1000 have 3 in the tens place?", "role": "user" }, { "content": "To have a 3 in the tens place, the numbers must be in the following form: _3_, where the underscores can be any digit from 0 to 9 (including 0 and 9).\n\nFor the hundreds place, we can h...
math
microsoft/orca-math-word-problems-200k
[ { "content": "Clara brings a package of 100 stickers to school. She gives 10 stickers to a boy she likes. She gives half of the stickers which she has left to her best friends. How many stickers does Clara have left?", "role": "user" }, { "content": "She gives the boy she likes 10 stickers.\nAfter g...
math
openai/gsm8k
[ { "content": "Jennifer wants to go to a museum. There is one 5 miles away from her home and one 15 miles away. If Jennifer goes to both museums on x separate days, how many miles total will she travel?\nIf we know the answer to the above question is 40, what is the value of unknown variable x?", "role": "us...
math
meta-math/MetaMathQA
[ { "content": "List and explain 3 steps to find a job online.", "role": "user" }, { "content": "Here are three steps to finding a job online: \n\n1. Create an online job search profile. This should include your job experience, skills, and accomplishments, as well as a professional headshot and a targ...
instruction
tatsu-lab/alpaca
[ { "content": "A triangle has a base of 10 centimeters (cm) and a height of 11 centimeters (cm). There is a square with a width of 8 centimeters (cm) and a length of 8 centimeters (cm), and the diameter of a circle is 8 centimeters (cm). Which shape has the widest area? Calculate the circumference ratio as 3.1."...
math
microsoft/orca-math-word-problems-200k
[ { "content": "Design a class in Python that computes the frequency of every word in a text document.\nText: \"This is a test text. Write a piece of code to find the frequency of each word in this text\"", "role": "user" }, { "content": "\"\"\"\nDesign a class to compute the frequency of every word i...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "To support the school outreach program, Einstein wants to raise $500 by selling snacks. One box of pizza sells for $12, a pack of potato fries sells for $0.30, and a can of soda at $2. Einstein sold x boxes of pizzas, 40 packs of potato fries, and 25 cans of soda. Einstein needs to raise 258 more ...
math
meta-math/MetaMathQA
[ { "content": "5/8 of shoppers at All Goods Available store prefer to avoid the check-out line on weekends and instead go through the express lane. If the number of shoppers in the store is 480, calculate the number of shoppers who pay at the check-out lane.", "role": "user" }, { "content": "At the s...
math
openai/gsm8k
[ { "content": "The government donated tons of sand to four Cities. City A received 16 1/2 tons of sand, City B received 26 tons of sand, and City C received 24 1/2 tons of sand. The supplier lost the data for City D; however, they know the total for all four cities was 95 tons. How many tons of sand did City D r...
math
meta-math/MetaMathQA
[ { "content": "Mark has 30 candies, Peter has 25 candies, and John has 35 candies. They decided to combine their candies together and share them equally. How many candies will each one of them have?", "role": "user" }, { "content": "The total number of the candies is 30 + 25 + 35 = <<30+25+35=90>>90....
math
openai/gsm8k
[ { "content": "Explain the following piece of JavaScript code.\nlet arr1 = [1,2,3,4];\nlet arr2 = [...arr1];", "role": "user" }, { "content": "This code creates a new array, arr2, which contains the same elements as the original array, arr1. The spread operator (...) is used to unpack the elements of...
code
sahil2801/CodeAlpaca-20k
[ { "content": "Create a Data Science program in Python that takes a set of numeric data and categorizes them into groups based on similarity.\ndata = [1,2,3,4,5]", "role": "user" }, { "content": "import numpy as np\n\ndef classify_data(data):\n clusters = {}\n data = np.array(data)\n mean = np.mean(d...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Design a Python algorithm to perform a Prefix Sum operation on an array.\n[1, 2, 3, 4]", "role": "user" }, { "content": "def prefix_sum(arr):\nresult = []\ns = 0\nfor x in arr:\n s += x\n result.append(s)\nreturn result\n\narr = [1, 2, 3, 4]\nprefix_sum(arr)", "role": "assist...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Melody planted sunflowers from two different seed packets. She found that the sunflowers from Packet A were 20% taller than the sunflowers from Packet B. If the sunflowers from Packet A were 192 inches tall, how tall were the sunflowers from Packet B?", "role": "user" }, { "content": "...
math
openai/gsm8k
[ { "content": "If Stacy bought two packs of printer paper for the office, with each pack containing 240 sheets of paper, and the office prints 80 one-page documents per day, how many days will the printer paper last in the office?", "role": "user" }, { "content": "Stacy bought two packs of printer pa...
math
meta-math/MetaMathQA
[ { "content": "Determine the distance, in units, between the points (3, -2) and (7, 5).", "role": "user" }, { "content": "Using the distance formula, the distance between two points $(x_1, y_1)$ and $(x_2, y_2)$ is given by\n$$\\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.$$\nIn this case, the points are $(3...
math
meta-math/MetaMathQA
[ { "content": "Perry, Dana, Charlie, and Phil played golf together every week. At the end of the season, Perry had won five more games than Dana, but Charlie had won 2 games fewer than Dana. Phil had won 3 games more than Charlie did. If Phil won a total of 12 games, how many more games did Perry win than did...
math
meta-math/MetaMathQA
[ { "content": "Alani earned some money for 3 hours of baby-sitting. At the same rate, she would need to baby-sit for 5 hours to earn $75. How much money did she earn for 3 hours of baby-sitting?", "role": "user" }, { "content": "Let's denote the hourly rate for baby-sitting as \\( R \\) dollars per h...
math
microsoft/orca-math-word-problems-200k
[ { "content": "Write a Python function to calculate factorial using recursion.", "role": "user" }, { "content": "def factorial(n): \n if n == 0: \n return 1\n else: \n return n*factorial(n-1)", "role": "assistant" } ]
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Determine if the sentence is a hyperbole.\nShe was so excited that she jumped a mile out of joy.", "role": "user" }, { "content": "Yes", "role": "assistant" } ]
instruction
tatsu-lab/alpaca
[ { "content": "Linda's bag has 2 dimes, 6 quarters, and 5 nickels. Her mother gives her 2 more dimes, 10 quarters, and twice as many nickels as she has. How many coins does she have altogether?", "role": "user" }, { "content": "Let's calculate the total number of coins Linda has after her mother give...
math
microsoft/orca-math-word-problems-200k
[ { "content": "Let $f(x)=2x^4+x^3+x^2-3x+r$. For what value of $r$ is $f(2)=0$?", "role": "user" }, { "content": "We substitute $x=2$ into the expression for $f(x)$ and set the result equal to 0: \\[0=2(2)^4+(2)^3+(2)^2-3(2)+r.\\]\nSimplifying, we have $0=32+8+4-6+r$, or $0=38+r$.\nSolving for $r$, w...
math
meta-math/MetaMathQA
[ { "content": "Name the class for this object-oriented design.\n[Image]", "role": "user" }, { "content": "The class name for this object-oriented design should be Foo.", "role": "assistant" } ]
code
sahil2801/CodeAlpaca-20k
[ { "content": "Reword the following sentence so its grammar is correct.\nDid you has study for the exam?", "role": "user" }, { "content": "Did you study for the exam?", "role": "assistant" } ]
instruction
tatsu-lab/alpaca
[ { "content": "If Brandon can catch 6 squirrels or 2 rabbits in 1 hour, and each squirrel has 300 calories while each rabbit has 800 calories, how many additional calories will he obtain per hour if he catches squirrels instead of rabbits?", "role": "user" }, { "content": "If Brandon can catch 6 squi...
math
meta-math/MetaMathQA
[ { "content": "Winwin won $50 in a lottery. She paid 20% for the tax and she paid $5 for the processing fee. How much was she able to take home?", "role": "user" }, { "content": "Winwin won $50 in the lottery.\nShe paid 20% for the tax, so she paid 20/100 * $50 = $10 for the tax.\nShe also paid $5 fo...
math
meta-math/MetaMathQA
[ { "content": "Two standard 6-sided dice are rolled. What is the probability that the sum rolled is a perfect square?", "role": "user" }, { "content": "We can list all the possible outcomes when rolling two dice:\n(1,1), (1,2), (1,3), (1,4), (1,5), (1,6),\n(2,1), (2,2), (2,3), (2,4), (2,5), (2,6),\n...
math
meta-math/MetaMathQA
[ { "content": "Write a code to find the maximum of three numbers using if else.", "role": "user" }, { "content": "def maximum_of_three(x, y, z): \n if x > y and x > z: \n max = x \n elif y > x and y > z: \n max = y \n else: \n max = z \n return max", "role": "assi...
code
sahil2801/CodeAlpaca-20k
[ { "content": "Write a function in python for finding a substring of a given string\n\"Hello World\", \"lo Wo\"", "role": "user" }, { "content": "def find_substring(string, sub_string):\n indices = []\n for i in range(0, len(string)-len(sub_string)+1):\n if (string[i:i+len(sub_string)] == sub_st...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Construct a code to find the sum of a series of numbers entered by the user using Python.", "role": "user" }, { "content": "total = 0\ncount = 0\n\nwhile True:\n user_input = int(input(\"Enter an integer (enter 0 to stop): \"))\n if user_input == 0:\n break\n \n else...
code
iamtarun/python_code_instructions_18k_alpaca
[ { "content": "Among gray and white cat, gray cat is the heaviest. Gray cat is lighter than black cat, and the lightest is the yellow cat. What color is the heaviest cat?", "role": "user" }, { "content": "The heaviest cat is the black cat.", "role": "assistant" } ]
math
microsoft/orca-math-word-problems-200k
[ { "content": "Edit the following while loop to fix the error.\ni = 0\nwhile i <= 5:\n print(i) \n i = i + 1", "role": "user" }, { "content": "i = 0\nwhile i < 5:\n print(i) \n i = i + 1", "role": "assistant" } ]
code
sahil2801/CodeAlpaca-20k