Dataset Viewer
Auto-converted to Parquet Duplicate
prompt
stringlengths
25
1.41k
response
stringlengths
6
3.28k
reasoning
stringclasses
1 value
category
stringclasses
5 values
difficulty
stringclasses
4 values
source
stringclasses
1 value
verified
bool
1 class
id
stringlengths
16
16
According to the source, what factors are widely credited with causing changes in inflation?
The source says changes in inflation are widely attributed to increases in the money supply. It also points to fluctuations in real demand for goods and services, known as demand shocks, including changes in fiscal or monetary policy. Changes in available supplies, such as during energy crises, are identified as supply...
knowledge
easy
teacher
true
2f666d3ee2f25eb9
At a currency kiosk, each exchange costs a flat 2-dollar fee, and the remaining dollars are converted at a rate of 0.85 euros per dollar. If a traveler receives 34 euros after the fee is taken, how many dollars did they hand to the kiosk?
Let x be the dollars handed over. After the $2 fee, x - 2 dollars are converted. Thus 0.85(x - 2) = 34. Dividing by 0.85 gives x - 2 = 40, so x = 42. Therefore, \boxed{42}.
math
easy
teacher
true
2eea7b99ae0f244e
A CSV of sensor readings is shown below. If one row is selected uniformly at random, what is the probability that its status is "fault"? Give the probability as a fraction in lowest terms. sensor_id,status 1,ok 2,ok 3,fault 4,ok 5,ok 6,fault 7,ok 8,ok 9,fault 10,ok 11,ok 12,ok
There are 12 rows total. The rows with status "fault" are sensor_id 3, 6, and 9, so there are 3 fault rows. The probability is 3/12 = 1/4. \boxed{1/4}
math
easy
teacher
true
18cc574a4bd9c66e
I'm drafting next month’s ward rota and need a short explanation for the notes section: why we avoid giving anyone three consecutive night shifts. Can you explain the idea of sleep debt in plain English? It needs to be under 120 words, include a concrete example with shift times, and avoid clinical jargon.
Sleep debt is the gap between the sleep you need and the sleep you get. It builds up when shifts repeatedly cut into recovery time. Example: a nurse finishes a night shift at 07:30, sleeps 09:00–13:00 (4 hours), then starts the next night at 19:30. If that repeats for three nights, they may be 12–15 hours short of thei...
conversation
easy
teacher
true
23c833560602a935
You are triaging a support-ticket queue. Tickets are given as (id, severity, age_days): T-1042, high, 3 T-1007, medium, 9 T-1130, high, 7 T-1021, low, 12 T-1188, medium, 2 T-1055, high, 3 T-1099, low, 1 Produce the processing order: sort by severity (high, then medium, then low); within the same severity, older ticket...
{"order": ["T-1130", "T-1042", "T-1055", "T-1007", "T-1188", "T-1021", "T-1099"], "escalate": ["T-1130"]}
instruction
medium
teacher
true
1c2b726843311adc
I'm making chickpea-and-spinach curry for 7 people on Saturday. The original recipe serves 4 and calls for 2 tbsp oil, 1 onion, 3 garlic cloves, 1 tbsp ginger, 2 tsp curry powder, 1/2 tsp salt, 2 cups cooked chickpeas, one 14-oz can diced tomatoes, 5 oz spinach, and 1 cup coconut milk. Scale it to 7 servings, keep acti...
Scale factor: 1.75× (7 ÷ 4). Scaled ingredients: 3.5 tbsp oil; 2 medium onions (1.75 onions—use 1 large plus 1 medium, or 2 medium and accept a little extra); 5–6 garlic cloves (5.25); 1.75 tbsp ginger; 3.5 tsp curry powder; 7/8 tsp salt; 3.5 cups cooked chickpeas; two 14-oz cans diced tomatoes (1.75 cans—use both cans...
conversation
easy
teacher
true
0b76ecc384ac5243
A parking garage is built on a circular ramp. The attendant lists the spot clearances (integer heights) starting at an arbitrary spot and walking forward around the ramp, so the list is strictly increasing except for exactly one "wrap" where the values drop. All clearance values are distinct. Write a pure function wit...
```python def find_spot(clearances: list[int], target: int) -> int: lo, hi = 0, len(clearances) - 1 while lo <= hi: mid = (lo + hi) // 2 if clearances[mid] == target: return mid if clearances[lo] <= clearances[mid]: if clearances[lo] <= target < clearances[mid]...
coding
hard
teacher
true
77dfb1a109cfdcab
Support tickets are queued for dispatch. Each ticket is a tuple (ticket_id, priority, created), where ticket_id is an int, priority is an int from 1 (low) to 5 (high), and created is a distinct non-negative int (a creation counter; larger means newer). Dispatch order is: higher priority first; among equal priorities, o...
```python def dispatch(tickets: list[tuple[int, int, int]], min_priority: int) -> list[int]: eligible = [t for t in tickets if t[1] >= min_priority] eligible.sort(key=lambda t: (-t[1], t[2])) return [t[0] for t in eligible] ```
coding
medium
teacher
true
e2360d9fef6cebe4
Define a pure function `mean_gravity(height_m: float, drop_times_s: list[float]) -> float` that analyzes repeated free-fall measurements. For each drop time `t` in `drop_times_s`, compute the inferred gravitational acceleration `2 * height_m / (t * t)`, then return the arithmetic mean of these inferred values. `height_...
```python def mean_gravity(height_m: float, drop_times_s: list[float]) -> float: return sum(2.0 * height_m / (t * t) for t in drop_times_s) / len(drop_times_s) ```
coding
easy
teacher
true
a3b4f36a24290298
Write a plain-text league table for these four teams. Output exactly 4 lines, no header and no extra text. Each line must be `POS TEAM PTS` (single spaces, POS is the 1-based rank, PTS is the team's points). Sort by points descending; break ties by goal difference descending (higher GD ranks higher). Teams: Bears (12 p...
1 Bears 12 2 Cobras 12 3 Hawks 9 4 Doves 9
instruction
easy
teacher
true
880c9461bef6cacc
A motion sensor records the displacement of a cart during each of several equal time intervals. The first interval displacement is 3 cm, the second is 7 cm, and the third is 11 cm; the displacements continue in an arithmetic sequence. What is the total displacement of the cart over the first 8 intervals? Answer as an i...
The displacements form an arithmetic sequence with first term 3 and common difference 4. The first 8 terms are 3, 7, 11, 15, 19, 23, 27, 31. Their sum is \frac{8}{2}(2\cdot3 + 7\cdot4)=4(6+28)=136. \boxed{136}
math
easy
teacher
true
fdefd56a8bb9e969
A password policy forbids any character from appearing more than k times consecutively. Given password: str consisting only of lowercase English letters (1 <= len(password) <= 1000) and k: int (1 <= k <= 1000), return the minimum number of character positions that must be changed (each to any lowercase letter) so that ...
```python def min_changes(password: str, k: int) -> int: changes = 0 n = len(password) i = 0 while i < n: j = i while j < n and password[j] == password[i]: j += 1 run_length = j - i changes += run_length // (k + 1) i = j return changes ```
coding
medium
teacher
true
495dd205cb5c57de
Summarise the following rota changes for the ward handover: Mon day: Dr Shah swapped to Tue day; Tue day now Dr Shah; Mon day uncovered. Wed night: Nurse Okafor covering for Nurse Lin. Fri day: Pharmacist Reed added 08:00–12:00. Include only changes, name who covers each affected shift, and flag any uncovered shift in ...
Changes for ward handover: Mon day now uncovered. Tue day covered by Dr Shah (swapped from Mon). Wed night covered by Nurse Okafor (replacing Nurse Lin). Fri day added Pharmacist Reed 08:00–12:00. **Mon day remains uncovered.**
conversation
medium
teacher
true
cdf588d567b56459
A recipe for 7 people calls for an unknown whole number n of grams of rice. When the rice is divided into 7 equal portions, 3 grams remain; into 11 equal portions, 5 grams remain; and into 13 equal portions, 2 grams remain. Find the smallest positive integer n satisfying these conditions.
Solve the congruences: n ≡ 3 (mod 7), n ≡ 5 (mod 11), n ≡ 2 (mod 13). Combining the first two gives n = 38 + 77b. Substituting into the third: 38 + 77b ≡ 2 (mod 13), so 12b ≡ 3 (mod 13), hence b ≡ 10 (mod 13). Therefore n = 38 + 77(10 + 13c) = 808 + 1001c. The smallest positive solution is \boxed{808}.
math
medium
teacher
true
7dbe53c20f60b0f0
A cinema's seat chart is given as a rectangular matrix `seats` of 0s and 1s, where 0 = free seat and 1 = already booked, plus an integer `k >= 1` (seats needed together in one row). For a single row, define its *capacity* as the number of groups of k consecutive free seats it can hold: for each maximal run of consecut...
```python def best_row(seats: list[list[int]], k: int) -> int: best_idx = -1 best_cap = 0 for i, row in enumerate(seats): cap = 0 run = 0 for seat in row: if seat == 0: run += 1 else: cap += run // k run = 0 ...
coding
medium
teacher
true
10535472753da852
Write a function `count_alarm_activations(csv_text, low, high)` that simulates a hysteresis alarm over sensor readings. `csv_text` is a `str` containing a CSV whose first line is exactly the header `t,value`, followed by zero or more data lines of the form `<int>,<int>` (time, reading). Blank lines are ignored, and le...
```python def count_alarm_activations(csv_text, low, high): lines = csv_text.splitlines() alarm_on = False activations = 0 for line in lines[1:]: line = line.strip() if not line: continue parts = line.split(',') value = int(parts[1].strip()) if not ...
coding
medium
teacher
true
24996760cc221371
Create a password that satisfies this policy exactly: (1) length exactly 12 characters; (2) starts with an uppercase letter A-Z; (3) contains at least one lowercase letter, at least one digit, and at least one symbol from @ # % &; (4) contains no spaces; (5) does not contain the substring 'pass'. Respond with only the ...
Kx7@mQ2vRt9#
instruction
easy
teacher
true
dfdfa22207c98066
Who introduced the term "Standard Model," and what alternative priority claim does the source mention?
The source says the term "Standard Model" was introduced by Abraham Pais and Sam Treiman in 1975, referring to the electroweak theory with four quarks. It also says Steven Weinberg has since claimed priority. According to the source, Weinberg explained that he chose the term out of a sense of modesty and used it in 197...
knowledge
hard
teacher
true
1e5cf2c4ad4c4bf9
A deployment config diff replaces three route-selection constraints. The new merged config requires an integer token x to satisfy all three lines simultaneously: x ≡ 3 (mod 8) x ≡ 5 (mod 9) x ≡ 7 (mod 11) Find the least positive integer x that satisfies all three congruences. Answer as an integer.
Solve the first two congruences: x=3+8a, so 3+8a≡5 (mod 9). Thus 8a≡2, hence -a≡2, so a≡7 (mod 9). Then x=3+8(7+9b)=59+72b. Impose mod 11: 59+72b≡7 (mod 11), giving 4+6b≡7, so 6b≡3. Since 6^{-1}≡2 (mod 11), b≡6 (mod 11). Hence x=59+72(6+11c)=491+792c, and the least positive solution is \boxed{491}.
math
medium
teacher
true
5eaa5c4c88585b42
In a sports league, a season has matchdays 1 through n. Each club reports one or more closed intervals [a, b] of matchdays during which its stadium is unavailable. Intervals are inclusive. Return the number of distinct matchdays in [1, n] that are unavailable in at least one interval. Intervals that overlap or are adja...
```python def unavailable_matchdays(n: int, intervals: list[list[int]]) -> int: clipped = [] for a, b in intervals: left = max(1, a) right = min(n, b) if left <= right: clipped.append([left, right]) if not clipped: return 0 clipped.sort() total = 0 c...
coding
medium
teacher
true
b9a5af89796b68de
A music app builds a playlist from 5 distinct pop songs and 4 distinct rock songs. It plays all 9 songs exactly once, and no two rock songs may be adjacent. How many different playlists are possible? Give your answer as an integer.
Arrange the 5 distinct pop songs first: \(5!\). These create 6 gaps (before, between, and after the pop songs) where rock songs can be placed. To keep rock songs nonadjacent, choose 4 of these 6 gaps: \(\binom{6}{4}\). Arrange the 4 distinct rock songs in those gaps: \(4!\). Thus the total is \(5!\binom{6}{4}4! = 120\c...
math
medium
teacher
true
397cdd83f5cb9660
Write a pure function `to_usd(expr: str, rates: dict[str, float]) -> float` that parses a compact ledger expression and returns its net value in USD, rounded to 2 decimals. Specification: - `expr` is a string of terms separated by exactly one space (leading/trailing spaces are ignored). - Each term is: an optional sig...
```python def to_usd(expr: str, rates: dict[str, float]) -> float: tokens = expr.strip().split() total = 0.0 for i in range(0, len(tokens), 2): cur = tokens[i] sign = 1 if cur[0] == '+': cur = cur[1:] elif cur[0] == '-': sign = -1 cur = cur...
coding
hard
teacher
true
02d3c9793938b068
Smart-home request: 'Turn on the kitchen light and set its brightness to 75 percent.' The device must reply with exactly one line and nothing else, in the form: SET <device> <brightness>. Use the device name in lowercase with spaces replaced by underscores (kitchen light -> kitchen_light), and give brightness as an int...
SET kitchen_light 75%
instruction
easy
teacher
true
3ec6475fa47724ea
A geometry service logs a polygon as `POLY (0,0) (6,0) (6,4) (3,7) (0,4)`. The parser treats consecutive coordinate pairs as vertices of a simple polygon in the given order and computes its area using the shoelace formula. What area should the parser log? Answer as an integer.
Apply shoelace: \sum x_i y_{i+1}=0+24+42+12+0=78; \sum y_i x_{i+1}=0+0+12+0+0=12. Area=|78-12|/2=33. \boxed{33}
math
medium
teacher
true
554f8870078f9e5f
I'm running a 6-team office foosball round-robin over 5 weeks. Every team must play every other team exactly once, with 3 matches per week and no team playing twice in the same week. Please give the full five-week fixture list and a blank league-table template with columns for played, wins, draws, losses, goals for, go...
Teams: A, B, C, D, E, F. Week 1: A-F, B-E, C-D Week 2: A-E, F-D, B-C Week 3: A-D, E-C, F-B Week 4: A-C, D-B, E-F Week 5: A-B, C-F, D-E Blank table (all zeros, alphabetical): | Team | P | W | D | L | GF | GA | GD | Pts | |------|---|---|---|---|----|----|----|-----| | A | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | B ...
conversation
hard
teacher
true
25510f7d11740943
Write a pure function count_spikes(csv_text: str, threshold: float) -> int. The input csv_text is a CSV string with a header line exactly 't,value' followed by zero or more data rows of the form '<int>,<float>'. Each data row is one sensor reading. Return the number of readings whose value is strictly greater than thre...
```python def count_spikes(csv_text: str, threshold: float) -> int: lines = csv_text.splitlines() if not lines: return 0 count = 0 for line in lines[1:]: if not line: continue _, value = line.split(',') if float(value) > threshold: count += 1 r...
coding
easy
teacher
true
8ffa843d6885a434
A bank statement prints amounts from an integer number of cents. Write a pure function `format_cents(cents: int) -> str` that returns the amount as a string with a dollar sign, exactly two decimal digits for the cents part, no thousands separators, and a leading minus sign placed before the dollar sign for negative amo...
```python def format_cents(cents: int) -> str: sign = "-" if cents < 0 else "" cents = abs(cents) return f"{sign}${cents // 100}.{cents % 100:02d}" ```
coding
easy
teacher
true
86fea19217f45778
A hospital ward must be continuously staffed by nurses over the half-open time window [start, end). Each nurse i offers one contiguous availability interval [a_i, b_i) and, if chosen, works exactly that interval. A set of nurses is valid if the union of their intervals contains [start, end). Intervals that extend outsi...
```python def min_nurses(start: int, end: int, avail: list[tuple[int, int]]) -> int: cur = start count = 0 while cur < end: best = cur for a, b in avail: if a <= cur and b > best: best = b if best == cur: return -1 cur = best co...
coding
hard
teacher
true
327a41182a169dd2
I'm planning 6 weeks to prep for the AWS Solutions Architect Associate exam, weekdays only, 45 minutes a day. Turn the plan into a music playlist: each track is one day's session, in order, with a title, duration, and one-sentence focus. Include exactly two review tracks per week and end with a full practice-exam track...
Copy this tracklist; every track is 45:00 and each week has exactly two Review tracks. Week 1 1. Domain 1: VPC core — 45:00 — Sketch VPC, subnets, route tables, and NAT from memory. 2. Domain 1: Security groups vs NACLs — 45:00 — Compare stateful and stateless rules with three exam-style scenarios. 3. Review: VPC and s...
conversation
easy
teacher
true
f40ff196a99873f9
I’m measuring g with a 1.000 m pendulum using a photogate at the bottom of the swing. My 50-cycle times vary from 100.4 s to 101.2 s, so T ≈ 2.008–2.024 s and g ≈ 9.64–9.79 m/s². I expected scatter under 0.1%. What’s the most likely issue, and what single check should I do next? A good answer must name a plausible caus...
Most likely issue is photogate trigger jitter at the bottom of the swing: the bob is wide and moving fastest there, so the beam can cross different parts of it by a few milliseconds per pass. Single check: mount a thin opaque flag on the bob or move the gate so the beam crosses the bob center at the same chord every pa...
conversation
medium
teacher
true
f98afab3f6ba6f25
A phone bill lists 3 calls. Each call is independently misbilled with probability 1/20. Given that at least one call on the bill is misbilled, what is the probability that exactly one call is misbilled? Answer as a reduced fraction.
Let X be the number of misbilled calls. X ~ Binomial(3, 1/20).\nP(X=1)=C(3,1)(1/20)(19/20)^2=1083/8000.\nP(X>=1)=1-P(X=0)=1-(19/20)^3=1141/8000.\nThus P(X=1 | X>=1)=P(X=1)/P(X>=1)=(1083/8000)/(1141/8000)=1083/1141.\n\boxed{1083/1141}
math
medium
teacher
true
8f087070f7ce0937
We need a contract clause requiring our SaaS vendor to send recommendations for config changes. Make it enforceable: at least monthly, based on observed usage, ranked by impact, flag anything conflicting with our security baseline, and give a cure period. Under 150 words.
Vendor shall deliver to Customer, no less frequently than monthly, a written set of recommendations for configuring and operating the Service. Each recommendation shall (a) be based on observed usage data from the preceding month; (b) state the expected impact and be ranked by impact; (c) identify any conflict with Cus...
conversation
hard
teacher
true
ecb895cd4a35407a
Weekly step report. My steps for Monday through Sunday were: 8123, 10450, 9999, 12040, 7500, 10000, 6400. Reply with exactly 9 lines, no header and no blank lines. Lines 1-7 must be '<Day>: <steps> steps - <status>' for Monday..Sunday in order, where status is exactly 'goal met' if steps >= 10000, otherwise exactly 'go...
Monday: 8123 steps - goal missed Tuesday: 10450 steps - goal met Wednesday: 9999 steps - goal missed Thursday: 12040 steps - goal met Friday: 7500 steps - goal missed Saturday: 10000 steps - goal met Sunday: 6400 steps - goal missed Total: 64512 Average: 9216.0
instruction
medium
teacher
true
be239084954c9f9f
What new capabilities did PostgreSQL 18 introduce, and what was the reported status of PostgreSQL 19 as of mid-2026?
PostgreSQL 18 was released on September 25, 2025, and introduced a new asynchronous I/O (AIO) subsystem. This subsystem enables database users to perform concurrent I/O tasks such as readahead and sequential scan, and the source reports up to a 3x performance improvement for storage reads in some workloads. The release...
knowledge
easy
teacher
true
71ea9434668fed6f
A password policy requires the password to be the smallest possible value of m+n, where m and n are positive integers with m<n and 1/m + 1/n = 1/6. Determine the password.
Since 1/m + 1/n = 1/6, multiply by 6mn: 6n + 6m = mn, so mn - 6m - 6n = 0. Add 36: (m-6)(n-6)=36. With m<n and positive, test factor pairs a=m-6, b=n-6 with ab=36 and a<b: (1,36),(2,18),(3,12),(4,9). Then m+n=12+a+b, minimized by (a,b)=(4,9), giving m=10, n=15, and m+n=25. Indeed 1/10+1/15=1/6. Therefore the password i...
math
medium
teacher
true
14c6ad156870f607
A photo library stores each shooting session as a half-open integer interval (start, end) meaning photos were taken from start up to but not including end. Write a single pure function `photo_gaps(sessions)` that returns the idle gaps between sessions. Signature: photo_gaps(sessions: list[tuple[int, int]]) -> list[tup...
```python def photo_gaps(sessions): if not sessions: return [] ordered = sorted(sessions) merged = [] cur_start, cur_end = ordered[0] for start, end in ordered[1:]: if start <= cur_end: if end > cur_end: cur_end = end else: merged.app...
coding
medium
teacher
true
f30919be999592d0
Lab notebook, 2024-06-11 — submatrix scan. Define a *contiguous block* of an m×n integer matrix A as A[r1..r2][c1..c2] with 1 ≤ r1 ≤ r2 ≤ m and 1 ≤ c1 ≤ c2 ≤ n (rows and columns each contiguous, at least one of each). Its sum is the sum of its entries. Write a pure function with the signature `max_submatrix_sum(A)` w...
```python def max_submatrix_sum(A): m = len(A) n = len(A[0]) best = A[0][0] for top in range(m): col = [0] * n for bottom in range(top, m): row = A[bottom] for j in range(n): col[j] += row[j] cur = col[0] local = col[0] ...
coding
hard
teacher
true
e815ae3c688c4c6b
I'm designing a 'Memories' recommendation card for our photo library app. Available signals: capture time, location, face clusters, favorites, and view counts. Recommend the ranking logic for a weekly memory, including hard filters, tie-breakers, and a diversity rule. Keep it to 5 bullets max; no generic 'use ML' advic...
1) Score candidates: 0.45 recency (exponential decay, 30-day half-life) + 0.25 face-cluster co-occurrence with 3+ distinct people + 0.20 location novelty (first visit in 12 months) + 0.10 favorite ratio. 2) Hard filters: exclude screenshots, blurry shots below sharpness threshold, and duplicates shown in the last 8 wee...
conversation
hard
teacher
true
beb1702197f538b7
A physics detector can run at most one measurement at a time. Each candidate measurement is a half-open time interval [start, end) in seconds, represented as a tuple (start, end) of numbers with start < end. Two measurements conflict only if their intervals overlap; if one ends exactly when another starts, they do not ...
```python def max_measurements(intervals: list[tuple[float, float]]) -> int: count = 0 last_end = None for start, end in sorted(intervals, key=lambda interval: interval[1]): if last_end is None or start >= last_end: count += 1 last_end = end return count ```
coding
easy
teacher
true
827d7aee02345a37
Write a pure function `summarize(csv_text: str) -> dict` that parses a CSV string of sensor readings and aggregates them per sensor. Rules: - `csv_text` is a `str`. Its first line is always exactly the header `sensor,value`. Following lines are data rows of the form `name,int_value` where `name` is a non-empty string ...
```python def summarize(csv_text): result = {} lines = csv_text.split('\n') for line in lines[1:]: if not line.strip(): continue name, value_text = line.split(',') value = int(value_text) if name in result: entry = result[name] entry[0] += ...
coding
medium
teacher
true
09a2ce3e6946f611
A shopping cart contains only apples and bananas. Apples cost $0.90 each and bananas cost $0.50 each. If the numbers of apples and bananas in the cart were swapped, the cart's total cost would increase by exactly $4.80. The cart currently contains 26 fruits total. How many apples are in the cart? Report the answer as a...
Let a be apples and b be bananas.\n\na+b=26.\n\nSwapped cost minus current cost = (0.90b+0.50a)-(0.90a+0.50b)=0.40(b-a)=4.80.\n\nThus b-a=12. Solving with a+b=26 gives a=7, b=19.\n\n\boxed{7}
math
hard
teacher
true
d4d6c70f132e7c90
Using the catalogue records below, output one line for each item whose status is 'available', sorted in ascending order by call number, using the exact format `<CALL> | <TITLE> | <AUTHOR>` (single spaces around each pipe). No header line, no blank lines, no extra commentary. Records: 1. CALL: 005.73 | TITLE: Algorithm...
005.10 | Data Structures | R. Okoro 005.73 | Algorithms | S. Das 823.91 | Dubliners | J. Joyce
instruction
easy
teacher
true
26b5a706ec4b10e8
Summarise these standup notes for me in 3 bullets, one per topic, and include the owner and date where given. No intro, just the bullets. Notes: Priya will send the revised budget by March 14. Leo flagged that the staging server is down; Sam owns the fix, targeting Friday. The team agreed to postpone the launch review...
• Priya: send revised budget by March 14. • Sam: fix staging server by Friday (Leo flagged outage). • Team: launch review postponed to April 2.
conversation
hard
teacher
true
071d6f1258ca7a13
Lab notebook, run 14. Sandpile stabilization. We model a table of sand columns as a rectangular grid of non-negative integers (grains per cell). A cell is unstable when it holds 4 or more grains; it topples, losing 4 grains and giving 1 grain to each of its four orthogonal neighbours. Grains that would fall off the ed...
```python def avalanche(grid: list[list[int]]) -> list[list[int]]: h = len(grid) w = len(grid[0]) a = [row[:] for row in grid] q = [] for r in range(h): for c in range(w): if a[r][c] >= 4: q.append((r, c)) head = 0 dirs = ((-1, 0), (1, 0), (0, -1), (0, 1))...
coding
medium
teacher
true
536573030e986790
A backup script packs files onto volumes. Given file sizes `sizes` (a list of positive ints, each <= `capacity`) and a volume `capacity` (positive int), return the minimum number of volumes needed so that every file is stored whole on exactly one volume and the sum of sizes on each volume is at most `capacity`. Files c...
```python def min_backup_volumes(sizes: list[int], capacity: int) -> int: items = sorted(sizes, reverse=True) n = len(items) if n == 0: return 0 best = [n] remaining = [] def search(i: int) -> None: if i == n: best[0] = min(best[0], len(remaining)) retur...
coding
hard
teacher
true
765d74a6ef0c881c
Under Clause 7.3, the Contractor shall pay a late-delivery fee of $12 for each day by which delivery exceeds 5 days. If the total late-delivery fee owed is $180, how many days late was the delivery?
Let d be total days late. The fee applies to days beyond 5, so 12(d-5)=180. Thus d-5=15, giving d=20. \boxed{20}
math
easy
teacher
true
1509773710f3313b
Help me write an email to my bank disputing a $47.23 charge on my checking statement. It says 'PETCO 0842' on March 12, but I never shopped there. My account ends in 4417. The email should be polite but firm, request a provisional credit, ask what documentation they need, and stay under 150 words.
Subject: Dispute of Unauthorized Charge – Account Ending 4417 Dear Customer Service, I am writing to dispute a $47.23 charge on my checking account ending in 4417. The charge appears on my statement as "PETCO 0842" dated March 12. I did not authorize this transaction and have never shopped at Petco. Please investiga...
conversation
hard
teacher
true
ab5230fcf5e2b9c0
A smart thermostat computes its displayed setpoint S (in °C) from the room sensor reading x (in °C) using S = sqrt(3x + 4). The controller adjusts until the sensor reading and displayed setpoint satisfy x + S = 8. Find x.
Given S=8-x and S=\sqrt{3x+4}, square both sides: (8-x)^2=3x+4. This gives x^2-19x+60=0, so (x-4)(x-15)=0. Since S=8-x must be nonnegative, x=15 is extraneous; checking x=4 gives S=4 and 4+4=8. Thus \boxed{4}.
math
hard
teacher
true
17d260bfe1d67436
Photon arrival times are recorded as a list of floats, in nanoseconds. A coincidence window is a nonnegative float, in the same units. Define the coincidence count of an interval [a, a+window] as the number of arrival times t with a <= t <= a+window. Write a pure function `max_coincidences(times: list[float], window: f...
```python def max_coincidences(times: list[float], window: float) -> int: if not times: return 0 ts = sorted(times) left = 0 best = 0 for right, t in enumerate(ts): while t - ts[left] > window: left += 1 count = right - left + 1 if count > best: ...
coding
medium
teacher
true
3b9a1adaa75abe25
In a hospital's night-shift rota, Dr. Patel is scheduled on every day whose number is congruent to 5 modulo 8, and Dr. Chen is scheduled on every day whose number is congruent to 3 modulo 11. Day numbers start at 1. A night is double-covered when both doctors are scheduled. Find the smallest day number greater than 50 ...
Solve the simultaneous congruences n ≡ 5 (mod 8) and n ≡ 3 (mod 11). Let n = 5 + 8k. Then 5 + 8k ≡ 3 (mod 11), so 8k ≡ 9 (mod 11). Since 8^{-1} ≡ 7 (mod 11), k ≡ 63 ≡ 8 (mod 11). Thus n = 5 + 8·8 = 69, which is greater than 50 and satisfies both congruences. \boxed{69}
math
medium
teacher
true
3ab9e6f3a3219b2b
Who first proposed that a body could be so massive that light could not escape, and what did each propose?
The idea was first proposed in the late 18th century by John Michell and independently by Pierre-Simon Laplace. Michell, in a short part of a letter published in 1784, calculated that a star with the same density but 500 times the radius of the Sun would not let any emitted light escape. Laplace made a qualitative sugg...
knowledge
easy
teacher
true
481a856191bbcf36
A hospital records shift availability as a binary matrix `avail`: `avail[i][j] == 1` means nurse `i` can work shift `j`, and `0` means they cannot. Each nurse may be assigned to at most one shift, and each shift may be filled by at most one nurse. Write a pure function `max_assignments(avail)` that returns the maximum ...
```python def max_assignments(avail: list[list[int]]) -> int: if not avail: return 0 n = len(avail) m = len(avail[0]) match = [-1] * m def dfs(u, seen): for v in range(m): if avail[u][v] == 1 and not seen[v]: seen[v] = True if match[v] == ...
coding
hard
teacher
true
8977372f4fba676f
Write a pure function `count_forced_resets(created_day: int, expiry_days: int, login_days: list[int]) -> int`. The password is created on `created_day` (an int >= 0). `expiry_days` is a positive int. The password is valid for exactly `expiry_days` calendar days including the creation/reset day: if the current validity...
```python def count_forced_resets(created_day: int, expiry_days: int, login_days: list[int]) -> int: start = created_day resets = 0 for d in login_days: if d >= start + expiry_days: resets += 1 start = d return resets ```
coding
medium
teacher
true
7ccc3e60f79f9e5e
A school day has periods numbered 0, 1, 2, ... from the start of the day. A student's free periods are encoded as a single non-negative integer `free_mask`, where bit i (value 2**i) is 1 if period i is free and 0 if it is busy. Write a pure function `longest_free_block(free_mask: int) -> int` that returns the length of...
```python def longest_free_block(free_mask: int) -> int: best = 0 current = 0 while free_mask: if free_mask & 1: current += 1 if current > best: best = current else: current = 0 free_mask >>= 1 return best ```
coding
medium
teacher
true
77e1e153fbb71dda
Draft an email to a client rescheduling Thursday's call. Permission matrix: ALLOWED — suggest a subject line, draft the body, offer two alternate time slots. NOT ALLOWED — invent client or company names, send the email, mention refunds, or add attachments. Use placeholders and keep it under 120 words.
Subject: Rescheduling our Thursday call Hi [Client name], I’m writing to reschedule our Thursday call. Would [Day, Date, Time] or [Day, Date, Time] work for you? If neither works, please share a couple of windows and I’ll adjust. Best, [Your name]
conversation
medium
teacher
true
8ab0f22dbb004887
A library has 12 distinct books to display in a single row: 5 mathematics books and 7 books from other subjects. In how many ways can all 12 books be arranged so that no two mathematics books are adjacent?
Arrange the 7 non-mathematics books first: 7! ways. This creates 8 gaps around/ between them. Choose 5 distinct gaps for the 5 distinct mathematics books and arrange them: \binom{8}{5}5! ways. Total = 7!\binom{8}{5}5! = 5040\cdot56\cdot120 = 33{,}868{,}800. \boxed{33868800}
math
medium
teacher
true
99372800cbb25489
Write a pure recursive function shift_clock(clock: tuple[int, int], delta_hours: int) -> tuple[int, int]. clock is (hour, minute) with 0 <= hour < 24 and 0 <= minute < 60. delta_hours is an int and may be negative. Return the clock time after adding delta_hours hours, keeping minutes unchanged and wrapping hours modulo...
```python def shift_clock(clock: tuple[int, int], delta_hours: int) -> tuple[int, int]: hour, minute = clock if delta_hours == 0: return (hour, minute) if delta_hours > 0: return shift_clock(((hour + 1) % 24, minute), delta_hours - 1) return shift_clock(((hour - 1) % 24, minute), delta_h...
coding
easy
teacher
true
0c188d3bc1bab12c
I'm reading a lease clause: 'Time is of the essence with respect to Landlord's delivery of the Premises.' I think this just means the landlord should aim to be on time, but if delivery slips a week it's not a big deal unless I can prove lost profits. Correct me. A good answer should name the misconception, state the ac...
Your misconception is that 'time is of the essence' is only a scheduling preference. It is not: it makes timely delivery a material term of the lease. If Landlord misses the delivery date, that is a breach of a material obligation, not a minor delay; Tenant can treat the deadline as enforceable and, depending on the re...
conversation
hard
teacher
true
c35575e47a20f913
Compute a cart summary for these items: Apple x3 @ $1.25, Bread x1 @ $3.40, Cheese x2 @ $7.50, Detergent x1 @ $12.00, Eggplant x2 @ $2.10. Rules: (1) each line total is quantity times unit price, rounded to 2 decimals; (2) any line total of $10.00 or more gets a 15% discount, and the printed line value is the discounte...
1. Cheese: $12.75 2. Detergent: $10.20 3. Eggplant: $4.20 4. Apple: $3.75 5. Bread: $3.40 Subtotal: $38.35 Discount: $4.05 Total: $34.30 Free shipping: yes
instruction
medium
teacher
true
38488962baa7868a
Write a pure function max_concurrent_lessons(intervals) that returns the maximum number of lessons running at the same time. `intervals` is a list of lessons, each given as a two-element list [start, end] of integers with start < end; each lesson occupies the half-open time range [start, end), so a lesson ending at tim...
```python def max_concurrent_lessons(intervals: list[list[int]]) -> int: events = [] for start, end in intervals: events.append((start, 1)) events.append((end, -1)) events.sort(key=lambda event: (event[0], event[1])) current = 0 best = 0 for _, delta in events: current +=...
coding
medium
teacher
true
df931a61b77534be
A fitness tracker groups a day's total step count S into bursts for a workout summary. It reports: grouping the steps by 12 leaves 7 extra steps; grouping by 25 leaves 13 extra steps; grouping by 33 leaves 4 extra steps. Find the smallest total step count S greater than 2024 that satisfies all three tracker reports.
The conditions are S≡7 (mod 12), S≡13 (mod 25), and S≡4 (mod 33). Combining the first two gives S=163+300t. Substituting into the third: 163+300t≡4 (mod 33), so -2+3t≡4 (mod 33), hence 3t≡6 (mod 33), giving t≡2 (mod 11). Thus S=163+300(2+11u)=763+3300u. The smallest value greater than 2024 occurs at u=1, giving S=4063....
math
hard
teacher
true
d4e0a70711ca1883
In a chat app, you can pin 3 different stickers from a set of 7 stickers to the top of a conversation. The order of the 3 pinned stickers from left to right matters. How many different ordered pin bars can you make?
Choose the first sticker: 7 options. Choose the second: 6 remaining options. Choose the third: 5 remaining options. Total ordered pin bars: 7 × 6 × 5 = 210. Thus \boxed{210}.
math
easy
teacher
true
29c4907a98c0d306
Plan three meetings on 2025-03-10 using these fixed UTC offsets (ignore DST): Tokyo=UTC+9, Kolkata=UTC+5:30, London=UTC+0. Meetings: Tokyo 09:00, Kolkata 14:30, London 08:15, all local on 2025-03-10. Convert each to UTC, sort ascending by UTC instant, and express each instant in Kolkata local time. Output exactly 4 lin...
2025-03-10T00:00Z -> Tokyo @ 2025-03-10 05:30 2025-03-10T08:15Z -> London @ 2025-03-10 13:45 2025-03-10T09:00Z -> Kolkata @ 2025-03-10 14:30 COUNT=3
instruction
hard
teacher
true
029cb8d31221e57b
I need to compare two ways to measure a 10.00 Ω resistor: (A) two-wire with 0.01 Ω total lead resistance, (B) four-wire. Which measured value is closer to 10.00 Ω, and by how much? Give both measured values and state which method to pick; keep it to the numbers.
Two-wire reads 10.01 Ω (error +0.01 Ω); four-wire reads 10.00 Ω (error 0.00 Ω). Four-wire is closer by 0.01 Ω, so pick four-wire.
conversation
easy
teacher
true
c507efaaff0b1def
A hospital rota has two recurring shifts: Nurse A works every 4th day, and Nurse B works every 6th day. Both nurses work on day 1. On what day number will they next both work together?
Nurse A works on days 1, 5, 9, 13, ... (every 4 days). Nurse B works on days 1, 7, 13, ... (every 6 days). The next common workday occurs after the least common multiple of 4 and 6, which is 12 days. Starting from day 1, the next common day is 1 + 12 = 13. \boxed{13}
math
easy
teacher
true
39a031eb77e6ab98
How did ancient Sudanese societies use antibiotics, and what evidence supports this?
Ancient Sudanese societies in northern Sudan systematically consumed antibiotics as part of their diet as early as 350–550 CE. Chemical analyses of Nubian skeletons show consistent, high levels of tetracycline. Researchers believe they were brewing beverages from grain fermented with Streptomyces, a bacterium that natu...
knowledge
medium
teacher
true
ce2d2d3494abd04b
Write a 4-line phone bill summary for account 555-0142-7788 with charges: Line access $20.00, Data plan $35.50, International calls $7.25, Taxes $4.75. Requirements: exactly 4 lines, no extra text; line 1 is `Account: ****` followed by the last 4 digits of the account; line 2 is `Total due: $` followed by the sum of al...
Account: ****7788 Total due: $67.50 Charges: Taxes $4.75; International calls $7.25; Line access $20.00; Data plan $35.50 Late after: 2024-06-15
instruction
medium
teacher
true
d54fbca157318f60
A library catalogue stores books as dicts with exactly the keys "title" (str), "author" (str), and "year" (int). Write a pure function `group_by_author(books, min_year)` where `books` is a list of such dicts (possibly empty) and `min_year` is an int. It returns a dict mapping each author to the alphabetically sorted li...
```python def group_by_author(books, min_year): result = {} for book in books: if book['year'] >= min_year: result.setdefault(book['author'], []).append(book['title']) for titles in result.values(): titles.sort() return result ```
coding
medium
teacher
true
07cf3f410eb4854e
Write a pure function `ticket_machine(events: list[str]) -> str` that simulates a train ticket machine. `events` is a list of strings; each string is exactly one of "coin", "press", or "reset". The machine starts in state "idle" and has states "idle", "paid", and "dispensed". Transitions: idle: coin→paid, press→idle, r...
```python def ticket_machine(events): state = "idle" for event in events: if event == "reset": state = "idle" elif state == "idle": state = "paid" if event == "coin" else "idle" elif state == "paid": state = "dispensed" if event == "press" else "paid" ...
coding
easy
teacher
true
71ade798c92fb3d7
You are triaging a bug queue. Each bug is a tuple (bug_id, fix_time, deadline): bug_id is a unique nonempty string, and fix_time and deadline are positive ints. Starting at time 0 and fixing bugs one at a time without interruption, a bug is completed on time if its completion time is <= its deadline. Exactly one develo...
```python def max_bugs_fixed(bugs): import heapq total = 0 chosen = [] for _, fix, deadline in sorted(bugs, key=lambda b: b[2]): total += fix heapq.heappush(chosen, -fix) if total > deadline: total += heapq.heappop(chosen) return len(chosen) ```
coding
hard
teacher
true
61e117218ef4eb49
A soup recipe for 6 people uses 5/2 cups of broth and r cups of rice. When the recipe is scaled exactly for 7 people, the combined amount of broth and rice is 7 cups. Find r. Answer as a fraction in lowest terms.
The scaling factor from 6 to 7 people is 7/6. Thus (7/6)(5/2 + r) = 7. Dividing by 7 gives (1/6)(5/2 + r)=1, so 5/2 + r = 6. Therefore r = 6 - 5/2 = 12/2 - 5/2 = 7/2. \boxed{7/2}
math
medium
teacher
true
1808f2dcd62595ea
Write a short email to my landlord asking them to fix the heating. Don’t sound angry. Mention that the heat was out Jan 3–5 and ask them to confirm a repair appointment by Friday. Keep the body under 120 words.
Subject: Heating repair request — Jan 3–5 outage Dear [Landlord's Name], I’m writing to ask you to arrange repair of the heating in my apartment. The heat was out from Jan 3–5, and I want to make sure it’s fixed before it happens again. Could you please confirm by Friday what repair appointment has been scheduled? I’...
conversation
easy
teacher
true
495b50bc46105b57
Bug triage queue: duplicate bug reports must be grouped by a canonical title. Write a pure function `normalize_title(title: str) -> str` that returns the canonical form of a bug title. Input is always a `str`; output is a `str`. Rules, applied in order: (1) lowercase the title; (2) split on whitespace and rejoin tokens...
```python def normalize_title(title: str) -> str: s = title.lower() s = " ".join(s.split()) return s.rstrip(" .") ```
coding
easy
teacher
true
6d2e48cf6d591a83
Parse the log block below and emit a deduplicated error/warning report. Log block: 2024-05-01T09:12:03Z INFO auth Login ok 2024-05-01T09:12:07Z ERROR db E104 connection timeout 2024-05-01T09:11:59Z WARN cache W200 eviction slow 2024-05-01T09:12:07Z ERROR db E104 connection timeout 2024-05-...
09:11:59|WARN|W200|eviction slow 09:12:07|ERROR|E104|connection timeout 09:12:10|ERROR|E500|packet loss TOTAL=3
instruction
hard
teacher
true
a798f48c898765be
A school day has 5 periods. A student must schedule 3 different subjects chosen from 7 offered subjects, one subject per chosen period, and leave the other 2 periods free. How many different timetables are possible? Answer as an integer.
Choose 3 of the 5 periods to fill: \(\binom{5}{3}=10\). Assign 3 distinct subjects from 7 to these ordered periods: \(7\cdot6\cdot5=210\). Total: \(10\cdot210=2100\). Thus \(\boxed{2100}\).
math
easy
teacher
true
1d573b1c8a11b729
Write a pure Python function `merge_segments(segments)` for a music playlist. Each segment is a tuple `(start, end)` of integers representing the half-open time interval `[start, end)` in seconds, with `start < end`. Given a list of such segments, return a new list of non-overlapping segments sorted by start time that ...
```python def merge_segments(segments: list[tuple[int, int]]) -> list[tuple[int, int]]: if not segments: return [] ordered = sorted(segments, key=lambda seg: seg[0]) merged = [] current_start, current_end = ordered[0] for start, end in ordered[1:]: if start <= current_end: ...
coding
medium
teacher
true
c7ae28e79d6eaff4
Write a pure function `roles_with_all(permissions, required)`. `permissions` is a `dict[str, list[str]]` mapping a role name to the permissions it grants (order irrelevant, duplicates possible). `required` is a `list[str]` of permissions that are all needed. Return a `list[str]` of role names (keys of `permissions`) t...
```python def roles_with_all(permissions, required): req = set(required) return sorted(role for role, perms in permissions.items() if req <= set(perms)) ```
coding
easy
teacher
true
6ad128add3db0e08
I use iCloud Photos on my Mac and turned on “Optimize Mac Storage” so it keeps smaller versions locally. A friend told me that means the full-resolution originals get deleted from iCloud too, so I’d lose them. Is that true? Please answer specifically: (1) whether the originals are still safe in iCloud with Optimize Mac...
No—Optimize Mac Storage does not delete the full-resolution originals from iCloud. It only changes what your Mac keeps locally: Photos may replace local full-size files with optimized versions and download originals again when needed. Your iCloud Photos library still stores the originals. But deleting a photo in the Ph...
conversation
medium
teacher
true
73bf263719b92813
A payroll clerk has 5 employees, each with one personalized pay slip and one matching envelope. The clerk randomly places the 5 pay slips into the 5 envelopes, one slip per envelope. What is the probability that no employee receives the pay slip bearing their own name? Give the exact probability as a simplified fractio...
Count all arrangements: 5! = 120. Count derangements where no slip is in its matching envelope: !5 = 5!(1 - 1/1! + 1/2! - 1/3! + 1/4! - 1/5!) = 44. Probability = 44/120 = 11/30.\n\n\boxed{11/30}
math
medium
teacher
true
09979553c4dd57a8
A music app stores a rectangular playlist matrix `plays`, where `plays[i][j]` is the net number of listens for track `j` during session `i` (negative values mean skips). A contiguous block of sessions and tracks is called a playlist segment. Write a pure function `max_playlist_block(plays: list[list[int]]) -> int` that...
```python def max_playlist_block(plays): rows = len(plays) cols = len(plays[0]) best = None for top in range(rows): col_sums = [0] * cols for bottom in range(top, rows): for c in range(cols): col_sums[c] += plays[bottom][c] current = col_sums[0] ...
coding
hard
teacher
true
1b26d072989991f6
Write a pure function `delivery_order(n: int, edges: list[tuple[int, int]], start: int) -> list[int]` that returns the order in which a delivery van visits reachable locations using breadth-first search. Locations are integers `0` through `n-1`. `edges` describes an undirected graph; each tuple `(u, v)` means a road be...
```python def delivery_order(n: int, edges: list[tuple[int, int]], start: int) -> list[int]: adj = [set() for _ in range(n)] for u, v in edges: adj[u].add(v) adj[v].add(u) nbrs = [sorted(s) for s in adj] seen = [False] * n order = [] q = [start] seen[start] = True i = 0 ...
coding
easy
teacher
true
b95c45c39263a617
Write a pure function billable_minutes(calls: list[tuple[int, int]], free: list[tuple[int, int]]) -> int. All endpoints are integer minutes from the start of the month. Each interval is half-open [a, b) with a < b. calls is sorted by start time and non-overlapping; free may be unsorted and may overlap. Return the total...
```python def billable_minutes(calls, free): merged = [] for a, b in sorted(free): if not merged or a > merged[-1][1]: merged.append([a, b]) elif b > merged[-1][1]: merged[-1][1] = b total = 0 for a, b in calls: billable = b - a for fa, fb in merg...
coding
medium
teacher
true
8a94f88b2f082f16
In a photo library, thumbnails are generated by scaling an image so its longer side fits a maximum, never upscaling. Write a pure function `fit_scale(width: int, height: int, max_side: int) -> float` where `width` and `height` are non-negative pixel dimensions and `max_side` is a positive integer. Return the scale fact...
```python def fit_scale(width: int, height: int, max_side: int) -> float: longest = max(width, height) if width == 0 or height == 0: return 0.0 return min(1.0, max_side / longest) ```
coding
easy
teacher
true
f616c890a925acb3
The garage has three levels with these (capacity, occupied) pairs: B2 = (40, 40), B1 = (40, 37), B3 = (30, 18). Reply with exactly four lines and nothing else: one line per level formatted as `LEVEL <name> <occupied>/<capacity> <FREE|FULL>` (FREE when occupied < capacity, otherwise FULL), ordered by level name ascendin...
LEVEL B1 37/40 FREE LEVEL B2 40/40 FULL LEVEL B3 18/30 FREE TOTAL 95/110
instruction
easy
teacher
true
6941bda2e017b3d6
Why can transformers be trained more parallelly than recurrent neural networks, and what limitation remains with standard self-attention?
Transformers can be trained more parallelly because they do not process tokens one at a time, so their computations can be parallelized across sequence positions during training more readily than those of recurrent neural networks. In contrast, RNNs operate one token at a time from first to last and cannot operate in p...
knowledge
medium
teacher
true
07fbb47451509888
Write a pure function `granted_columns(matrix)` that takes a rectangular, non-empty matrix of integers (each 0 or 1) representing permissions: row i, column j is 1 if user i has permission j. Return a sorted list of the column indices that every user has (i.e., columns where every row contains 1). Do not modify the inp...
```python def granted_columns(matrix: list[list[int]]) -> list[int]: return [j for j in range(len(matrix[0])) if all(row[j] == 1 for row in matrix)] ```
coding
easy
teacher
true
901cab7a150876b2
Write a pure function parse_catalogue(text: str) -> list[tuple[str, str, int]]. Input text is a catalogue dump. Records are separated by newline characters. Lines containing only spaces/tabs are ignored. Every other line is a record of the exact form CALL|"TITLE"|COPIES: CALL and COPIES contain no |, ", or newline; COP...
```python def parse_catalogue(text): out = [] for line in text.split('\n'): if line.strip(' \t') == '': continue prefix, copies = line.rsplit('|', 1) call, quoted = prefix.split('|', 1) title = quoted[1:-1].replace('""', '"') out.append((call, title, int(copie...
coding
hard
teacher
true
1fd4727aa01ed2b7
My 4-year-old is 16 kg. The children’s ibuprofen bottle says 5 mL for ages 2–5, but my sister says give 10 mL because he’s tall. Please make a weight-based dosage chart using the 100 mg/5 mL concentration, correct whether 10 mL is right, and state the per-dose and daily limits.
Doubling the label’s age-band volume is not right for a 16 kg child. Ibuprofen dosing is by weight, not age band: 10 mg/kg per dose. At 16 kg, that is 160 mg. With 100 mg/5 mL (20 mg/mL), give 8 mL per dose every 6–8 hours as needed, no more than 4 doses in 24 hours (max 40 mg/kg/day = 640 mg/day). Chart for this conce...
conversation
easy
teacher
true
4407b7b8312f2139
A courier numbers delivery stops by positive integers. A stop is eligible only if its number x satisfies x ≡ 2 (mod 3), x ≡ 3 (mod 5), and x ≡ 2 (mod 7), and x has exactly four positive divisors. The route starts at the smallest eligible stop. What is the stop number?
The congruences combine to x ≡ 23 (mod 105). Checking x = 23 + 105k in increasing order, the first value with exactly four positive divisors is k=7: x = 758 = 2·379, which has divisors 1, 2, 379, 758. Thus the smallest eligible stop is \boxed{758}.
math
hard
teacher
true
1981ef6bd138e91b
Write a pure recursive function `balanced_parens(n: int) -> list[str]`. Input `n` is a nonnegative integer (`0 <= n <= 8`). Return every string containing exactly `n` '(' characters and `n` ')' characters such that no prefix has more ')' than '(', in ascending lexicographic order. Use recursion; do not use `itertools`....
```python def balanced_parens(n): if n == 0: return [""] def build(open_count, close_count, current): if open_count == n and close_count == n: return [current] result = [] if open_count < n: result.extend(build(open_count + 1, close_count, current + "(")...
coding
medium
teacher
true
7057acdb19fc858b
Explain compound interest to me as if you were my bank sending a monthly statement. Use a bank-statement format with "Opening balance," "Interest posted," and "Closing balance" lines, show two months at 1% monthly on $1,000, and add one plain-English sentence distinguishing compound from simple interest. Keep it under ...
MONTHLY STATEMENT — COMPOUND INTEREST Opening balance: $1,000.00 Month 1 interest posted: $10.00 (1% of $1,000.00) Closing balance: $1,010.00 Opening balance: $1,010.00 Month 2 interest posted: $10.10 (1% of $1,010.00) Closing balance: $1,020.10 Note: Compound interest pays interest on previously posted interest; simpl...
conversation
hard
teacher
true
e5b3cb72cdeccbe6
In a crafting event, a player must allocate 12 identical enhancement gems among 4 distinct gear slots (Weapon, Helmet, Boots, Ring). Each slot must receive at least 1 gem and at most 5 gems. How many different allocations are possible?
Let x_i be gems in each slot, with 1<=x_i<=5 and sum x_i=12. Set y_i=x_i-1, so 0<=y_i<=4 and sum y_i=8. Without upper bounds, count C(8+4-1,4-1)=C(11,3)=165. For violations y_i>=5, set y_i'=y_i-5; then sum y_i'=3, giving C(3+4-1,4-1)=C(6,3)=20 per variable. Since two variables cannot both be >=5, subtract 4*20=80. Tota...
math
medium
teacher
true
ec3ca4517e95b592
A library catalogue stores, for each shelf, a bitmask of which books are present: bit i of an integer is 1 iff book i is on that shelf. A "run" is a maximal set of consecutive set bits (bits i, i+1, ..., j all 1, with bits i-1 and j+1 clear or out of range). Write a pure function with signature `longest_run_mask(occup...
```python def longest_run_mask(occupied: int) -> int: x = occupied pos = 0 runs = [] best = 0 while x: if x & 1: start = pos length = 0 while x & 1: length += 1 pos += 1 x >>= 1 runs.append((star...
coding
hard
teacher
true
7ff7c955c827ba56
Write a pure function `earliest_available_start(booked: list[tuple[int, int]], duration: int) -> int` for a booking system. Each booked interval is a half-open time range [start, end) with integer start/end, and the list is sorted by start and non-overlapping. `duration` is a positive integer. Return the smallest integ...
```python def earliest_available_start(booked: list[tuple[int, int]], duration: int) -> int: t = 0 for start, end in booked: if t + duration <= start: return t if end > t: t = end return t ```
coding
easy
teacher
true
24dea51b17ac2cac
A village census records residents by village and age group as follows: | Village | Minors | Adults | |---|---:|---:| | A | 2 | 1 | | B | 1 | 2 | | C | 1 | 1 | A 4-person committee is chosen from these residents. It must contain exactly 2 minors and 2 adults, and at most one resident from village A in total. How many...
Label residents by village and age. Count valid committees by the number of A-residents allowed: at most 1.\n\nCase 0 A-residents: choose both non-A minors (B,C): 1 way; choose 2 of 3 non-A adults: \(\binom{3}{2}=3\) ways. Total 3.\n\nCase exactly 1 A-resident:\n- If it is an A-minor: choose 1 of 2 A-minors, 1 of 2 non...
math
medium
teacher
true
0b612e2f8a745b27
I wrote the wrong sample mass in my lab notebook and already signed the page. Can I just use white-out or overwrite the number so the page looks clean? A good answer should tell me the compliant correction method and what details to add so the record stays auditable.
Do not cover or remove the original entry. Draw one horizontal line through the incorrect mass so it remains legible, write the corrected value beside it, and add your initials and date. If the correction affects a calculation or result, add a brief note explaining why the value changed. This keeps the audit trail inta...
conversation
medium
teacher
true
99c64438d339d656
You are the support bot in a chat app. Reply to the customer with EXACTLY one JSON object and nothing else: no markdown fences, no prose before or after. Required keys, in this exact order: "reply", "priority", "tags", "char_count". Constraints: (1) reply must start with "Hi Ana," and end with a single "?" that is the ...
{"reply": "Hi Ana, order ORD-4471 is with the courier and tracking updates within 24 hours, can you confirm the delivery address?", "priority": "high", "tags": ["delivery", "logistics", "tracking"], "char_count": 118}
instruction
hard
teacher
true
aff88d10f870c182
A weather station records readings as (timestamp, temperature) pairs, but the log may be out of order. Write a pure function `first_time_at_least(readings, threshold)` where `readings` is a list of (int, float) tuples with unique integer timestamps, and `threshold` is a float. Sort the readings by timestamp, compute th...
```python def first_time_at_least(readings: list[tuple[int, float]], threshold: float) -> int | None: running_max = None for timestamp, temperature in sorted(readings, key=lambda reading: reading[0]): if running_max is None or temperature > running_max: running_max = temperature if r...
coding
medium
teacher
true
2cf237ef86e2fa84
Write a pure recursive function `total_playtime(playlist)` that returns the total duration in seconds of a music playlist. A playlist is recursively defined as either a nonnegative integer track duration, or a list of playlists. An empty list contributes 0 seconds. Do not mutate the input. Signature: `def total_playti...
```python def total_playtime(playlist): if isinstance(playlist, int): return playlist return sum(total_playtime(item) for item in playlist) ```
coding
medium
teacher
true
cdb5a58119b6f79f
You are closing out a weekly payroll run. Three employees worked these hours at these hourly rates: - alice: 45 hours at $20.00/hour - bob: 38 hours at $25.50/hour - carla: 40 hours at $18.75/hour Pay rules: 1. The first 40 hours are paid at the base rate; any hours beyond 40 are overtime and paid at 1.5x the base rat...
{"alice": {"gross": "950.00", "net": "807.50"}, "bob": {"gross": "969.00", "net": "823.65"}, "carla": {"gross": "750.00", "net": "637.50"}, "total_net": "2268.65"}
instruction
medium
teacher
true
5547cf456642864e
End of preview. Expand in Data Studio

DeepSeek V4.1 Flash — Synthetic SFT Dataset

880 synthetic instruction–response pairs generated by DeepSeek V4.1 Flash (deepseek-v4.1-flash) through the OpenDesign API, covering everyday conversation, Python coding, instruction-following, mathematics, and short knowledge questions.

The goal is a small, clean, easy-to-inspect corpus for supervised fine-tuning and for experiments in knowledge distillation — small enough to train on a single consumer GPU, structured enough to be useful as a reference for dataset construction.

This is an independent community dataset. It is not produced, reviewed, or endorsed by DeepSeek or OpenDesign. "DeepSeek" appears only to identify the teacher model that generated the text. All outputs are model-generated and have not been human-verified.

Overview

Examples 880 (682 fit within 320 tokens)
Language English
Teacher DeepSeek V4.1 Flash (deepseek-v4.1-flash)
Provider OpenDesign API
Approx. size 115k words of prompt+response text (712 KB)
Answers per example one
Multi-turn none
Teacher chain-of-thought excluded
Licence CC BY 4.0

Dataset statistics

Category Examples
Conversation 305
Coding 208
Instruction-following 177
Mathematics 163
Knowledge 27
Total 880

Difficulty labels (self-assigned by the generator, empty for the 433 examples produced in the first bulk pass):

Difficulty Examples
easy 175
medium 167
hard 105
unlabelled 433

Length: mean 71 words per prompt and 59 words per response (median 63 / 46). Longest prompt 238 words, longest response 578 words. All 208 coding examples are Python; 224 responses contain fenced code blocks.

Generation details

  • Teacher: DeepSeek V4.1 Flash
  • Exact API model identifier: deepseek-v4.1-flash
  • Provider: OpenDesign (amr-link.open-design.ai, OpenAI-compatible chat completions)
  • Total generation cost: $5.44 (billed by the provider)
  • Data type: synthetic instruction–response pairs, single turn
  • Language: English
  • Teacher chain-of-thought: excluded — it was requested by the API but discarded at capture time, never stored in the corpus and never trained on
  • Date generated: November 2026

A small number of rows (23 of 880, all from the early bulk pass) are attributable to the cheaper variant deepseek-v4.1-flash-eco; the remaining attributable rows are deepseek-v4.1-flash. Per-row attribution was not stored by the early generator, so the dataset as a whole is labelled by its dominant teacher. See provenance.json.

Data generation methodology

1. Prompting. Prompts were generated programmatically from category templates with sampled topics and difficulty levels, not taken from existing benchmarks. Coding and mathematics used a two-stage scheme: the teacher first wrote a problem, then a solution plus an executable program, then (for a subset) independently written hidden tests — keeping problem construction separate from solution construction reduces the chance that a solution quietly redefines the problem.

2. Automatic validation. Every candidate had to pass category-specific checks before being accepted:

Category Check
Coding solution program executed in a sandbox; its stdout compared against the stated answer; generated tests run against the reference and against a deliberately mutated function that must be rejected
Mathematics the accompanying program must compute the printed answer and agree with the value in the solution's \boxed{}; an independent checker program validates the arithmetic
Instruction-following required strings (must_contain) present and forbidden strings (must_not_contain) absent; the validator also has to accept the reference answer and reject an empty or corrupted one
Conversation non-empty, non-refusal, length and shape sanity
Knowledge grounded in a supplied dated source, with the answer span verified against it

3. Deduplication. Near-duplicates were rejected with token 5-shingle Jaccard similarity above 0.75 against previously accepted problems; the final set also has no duplicate ids and no duplicate prompts. Two responses are identical across different prompts.

4. Preparation. Accepted records were normalised to a single JSONL schema, truncated to nothing (no examples were cut), and a 320-token subset was derived for shorter-context training. Rejected candidates were retained separately for diagnosis and are not part of this release.

Dataset format

One JSON object per line:

Field Type Description
id string 16-hex-character identifier, derived from a hash of the source problem
prompt string the user request, including any formatting or length constraints
response string the teacher's final answer
reasoning string always empty in this release (chain-of-thought excluded)
category string conversation, coding, instruction, math, knowledge
difficulty string easy, medium, hard, or empty for the first bulk pass
source string always teacher
verified boolean automatic structural validation passed (see below)

Representative records, verbatim:

{"prompt": "Compare these two grocery delivery options for my weekly order: Plan A is $9.99/month plus $3.99 per delivery; Plan B is $14.99/month with free deliveries. I order 3 times per month. Which is cheaper per month and by how much? A good answer must name the cheaper plan and give both monthly totals.", "response": "Plan A costs $21.96/month: $9.99 + 3 \u00d7 $3.99 = $9.99 + $11.97. Plan B costs $14.99/month. Plan B is cheaper by $6.97/month.", "reasoning": "", "category": "conversation", "difficulty": "easy", "source": "teacher", "verified": true, "id": "78062b1f12fa0bf5"}
{"prompt": "Given a nonnegative integer n, return the integer obtained by setting the least significant bit position where n has a 0 to 1, leaving all other bits unchanged. Python integers are unbounded, so such a zero bit always exists. Edge cases include n = 0 (return 1) and values of the form (1 << k) - 1, where the next higher bit must be set.", "response": "```python\ndef set_lowest_zero_bit(n):\n    return n | (n + 1)\n```", "reasoning": "", "category": "coding", "difficulty": "", "source": "teacher", "verified": true, "id": "95b18be374944331"}
{"prompt": "A survey respondent's score is represented by x. The score satisfies the equation 3(x - 4) + 5 = 20. What is x? State your answer as an integer.", "response": "Subtract 5: 3(x-4)=15. Divide by 3: x-4=5. Add 4: x=9. \\boxed{9}", "reasoning": "", "category": "math", "difficulty": "easy", "source": "teacher", "verified": true, "id": "e2c3fb26d640e698"}
{"prompt": "Below is a phone bill. Compute the total amount due and reply with ONLY the amount, formatted as a dollar sign followed by exactly two decimal places (e.g. $12.34). No words, no punctuation other than the decimal point, no extra lines.\n\nBill:\n- Monthly plan: $35.00\n- Data overage: $12.50\n- Taxes and fees: $4.75\n- Autopay discount: -$5.00", "response": "$47.25", "reasoning": "", "category": "instruction", "difficulty": "easy", "source": "teacher", "verified": true, "id": "c5928095d54dd1f4"}

Quality and verification

"verified": true means the example passed the automatic structural checks described above. It does not mean the content is factually, mathematically, or algorithmically correct:

  • Mathematics was checked by executing a program and comparing printed values, which catches arithmetic slips but not a misread problem statement.
  • Coding solutions were executed and tested, but the tests themselves were model-generated; a plausible-looking solution can still be wrong outside the tested inputs.
  • Conversation and instruction examples were checked for shape, refusals, and required or forbidden strings — not for truthfulness or subtle obedience to every constraint.
  • Knowledge answers reflect the teacher's reading of a supplied source; the source text itself is not included in the prompt, so those examples are best treated as short factual Q&A rather than grounded citations.

The dataset has not been human-reviewed. Several responses are deliberately terse (one example is a single word) because the prompt demanded it.

Intended uses

  • Supervised fine-tuning of small and mid-sized language models
  • Behavioral distillation experiments against a stronger teacher
  • Conversational alignment and tone adjustment
  • Instruction-following and constraint-adherence training
  • Small-scale LLM experimentation and ablations
  • Fine-tuning quantized models under tight memory budgets

Not intended for: factual or medical/legal/financial advice, safety-critical applications, benchmark reporting as if human-written, or any use that assumes the responses are correct because they are marked verified.

Getting started

Both configurations load independently, so the 682-row subset is not double-counted against the full set:

from datasets import load_dataset

full = load_dataset("luvette/DeepSeek-V4.1-Flash-SFT", split="train")          # 880 rows
short = load_dataset("luvette/DeepSeek-V4.1-Flash-SFT", "short_320", split="train")  # 682 rows

print(len(full), full[0]["category"], full.features)

Convert to the standard chat format for SFT:

def to_messages(example):
    return {"messages": [
        {"role": "user", "content": example["prompt"]},
        {"role": "assistant", "content": example["response"]},
    ]}

chat = full.map(to_messages, remove_columns=full.column_names)

# then apply your tokenizer's chat template
# text = tokenizer.apply_chat_template(chat[0]["messages"], tokenize=False)

Filter to one category, or to examples that fit a context budget:

coding = full.filter(lambda x: x["category"] == "coding")
short_math = short.filter(lambda x: x["category"] == "math")

Experimental validation

As a downstream smoke test, the dataset was used to fine-tune a 9B ternary-weight chat model (rank-8 LoRA, 678 examples, two epochs, sequence length 320, learning rate 1e-4). Training took roughly two hours on a single RTX 3070 with 8 GB of VRAM and peaked at 7.3 GB.

A blind, order-randomised comparison of 15 held-out chat prompts (independent grading, identical decoding, both checkpoints served through llama.cpp) gave 13 wins, 1 tie, 1 loss for the fine-tuned model over its unmodified base, with a clear reduction in unnecessary verbosity: median answer length fell from 279 to 84 words and the rate of responses truncated at the token cap fell from 82 % to 0 %.

The same fine-tune regressed on MBPP (20/30 vs 24/30), and it became worse at strict numeric constraints (4/8 vs 6/8). These results are preliminary, come from a single small run, and are reported here only as an example of what the dataset can be used for. They do not show that the dataset improves model capability in general; the more likely reading is that it shifts style and brevity at some cost to task-specific detail.

Limitations

  • Small. 880 examples is enough for style and format adaptation, not for teaching new capabilities. Expect overfitting after a couple of epochs.
  • Synthetic. Every row is teacher-generated; errors, awkward phrasings, and unstated assumptions are inherited from the teacher. No human review.
  • Python-only coding. All 208 coding examples are Python, and many are short single-function tasks. Other languages are not represented.
  • Single-turn only. No conversations, no follow-ups, no tool calls, no multi-step agent traces.
  • No chain-of-thought. The teacher's reasoning was discarded, so the dataset teaches answers, not the reasoning that produced them.
  • Limited correctness checking. Validation is structural and program-execution based; it cannot establish that a claim is true.
  • Knowledge rows lack their sources. The 27 knowledge prompts refer to "the source" without including it.
  • Uneven difficulty labels. 433 rows carry no difficulty label because the field did not exist during the first bulk pass.
  • Style skew. Many prompts demand very short or rigidly formatted answers, which produces terse targets and can push a model toward brevity.

Licensing and attribution

The outputs were generated under the DeepSeek Open Platform Terms of Service, which assign the user rights in model outputs and explicitly permit their use for "personal use, academic research, derivative product development, training other models (such as model distillation)"; and under the OpenDesign Terms of Service, which state that users retain ownership of what they create. On that basis this compilation is released under CC BY 4.0 — see LICENSE.

If you use this dataset, credit the teacher model and the API provider as described below. Do not describe this dataset as official, endorsed, or reviewed by DeepSeek or OpenDesign, and do not use either company's marks in a way that suggests a partnership.

Acknowledgements

  • DeepSeek for the V4.1 Flash teacher model that generated every response.
  • OpenDesign for API access and the hosted routing that made generation practical.

Citation

@misc{luvette2026deepseekflashsft,
  title        = {DeepSeek V4.1 Flash — Synthetic SFT Dataset},
  author       = {luvette},
  year         = {2026},
  howpublished = {Hugging Face Datasets},
  url          = {https://huggingface.co/datasets/luvette/DeepSeek-V4.1-Flash-SFT},
  note         = {880 synthetic instruction-response pairs generated with DeepSeek V4.1
                  Flash (deepseek-v4.1-flash) via the OpenDesign API. Independently
                  produced; not affiliated with DeepSeek or OpenDesign.}
}
Downloads last month
122