mirror of
https://github.com/deepseek-ai/DeepSeek-Math
synced 2024-11-25 21:38:48 +00:00
60 lines
2.6 KiB
Python
60 lines
2.6 KiB
Python
|
from .few_shot_prompting import FewShotPrompting
|
||
|
|
||
|
few_shot_prompt = """
|
||
|
Problem:
|
||
|
Find the domain of the expression $\\frac{\\sqrt{x-2}}{\\sqrt{5-x}}$.
|
||
|
What of the following is the right choice? Explain your answer.
|
||
|
(A) [-5,-2), (B) [2,5), (C) [-2,-5), (D) [5,2)
|
||
|
Solution:
|
||
|
The expressions inside each square root must be non-negative. Therefore, $x-2 \\ge 0$, so $x\\ge2$, and $5 - x \\ge 0$, so $x \\le 5$. Also, the denominator cannot be equal to zero, so $5-x>0$, which gives $x<5$.
|
||
|
Therefore, the domain of the expression is $\\boxed{[2,5)}$.
|
||
|
Final Answer: The final answer is (B). I hope it is correct.
|
||
|
|
||
|
Problem:
|
||
|
If $\\det \\mathbf{A} = 2$ and $\\det \\mathbf{B} = 12,$ then find $\\det (\\mathbf{A} \\mathbf{B}).$
|
||
|
What of the following is the right choice? Explain your answer.
|
||
|
(A) 14, (B) 4, (C) 2, (D) 24
|
||
|
Solution:
|
||
|
We have that $\\det (\\mathbf{A} \\mathbf{B}) = (\\det \\mathbf{A})(\\det \\mathbf{B}) = (2)(12) = \\boxed{24}.$
|
||
|
Final Answer: The final answer is (D). I hope it is correct.
|
||
|
|
||
|
Problem:
|
||
|
Terrell usually lifts two 20-pound weights 12 times. If he uses two 15-pound weights instead, how many times must Terrell lift them in order to lift the same total weight?
|
||
|
What of the following is the right choice? Explain your answer.
|
||
|
(A) 12, (B) 20, (C) 16, (D) 15
|
||
|
Solution:
|
||
|
If Terrell lifts two 20-pound weights 12 times, he lifts a total of $2\\cdot 12\\cdot20=480$ pounds of weight. If he lifts two 15-pound weights instead for $n$ times, he will lift a total of $2\\cdot15\\cdot n=30n$ pounds of weight. Equating this to 480 pounds, we can solve for $n$: \\begin{align*}
|
||
|
30n&=480\\\\
|
||
|
\\Rightarrow\\qquad n&=480/30=\\boxed{16}
|
||
|
\\end{align*}
|
||
|
Final Answer: The final answer is (C). I hope it is correct.
|
||
|
|
||
|
Problem:
|
||
|
If the system of equations
|
||
|
|
||
|
\\begin{align*}
|
||
|
6x-4y&=a,\\\\
|
||
|
6y-9x &=b.
|
||
|
\\end{align*}has a solution $(x, y)$ where $x$ and $y$ are both nonzero, find $\\frac{a}{b},$ assuming $b$ is
|
||
|
nonzero.
|
||
|
What of the following is the right choice? Explain your answer.
|
||
|
(A) $-\\frac{2}{3}$, (B) $\\frac{2}{3}$, (C) $\\frac{1}{3}$, (D) $\\frac{4}{9}$
|
||
|
Solution:
|
||
|
If we multiply the first equation by $-\\frac{3}{2}$, we obtain
|
||
|
$$6y-9x=-\\frac{3}{2}a.$$Since we also know that $6y-9x=b$, we have
|
||
|
|
||
|
$$-\\frac{3}{2}a=b\\Rightarrow\\frac{a}{b}=\\boxed{-\\frac{2}{3}}.$$
|
||
|
Final Answer: The final answer is (A). I hope it is correct.
|
||
|
""".strip()
|
||
|
|
||
|
class CoTSATPrompt(FewShotPrompting):
|
||
|
def __init__(self):
|
||
|
super().__init__()
|
||
|
|
||
|
def format_prompt(self, task_input, task_output):
|
||
|
prompt = f"{few_shot_prompt}\n\nProblem:\n{task_input}\nSolution:\n{task_output}"
|
||
|
return prompt.rstrip()
|
||
|
|
||
|
def stop_words(self):
|
||
|
return ["\nProblem:"]
|