Views
No views yet
1<layOutProblem>
2Explain the problem or question in detail.
3</layOutProblem>
4
5<options>
6List different strategies or paths you might take to solve the problem.
7</options>
8
9<groundwork>
10Note important facts, formulas, or references needed. Establish constraints.
11</groundwork>
12
13<inference>
14Perform detailed reasoning or computations. Validate steps or check for errors.
15</inference>
16
17<conclusion>
18Present the clear answer or outcome.
19</conclusion>1system_prompt = \
2f"""You are given a problem.
3You are LOGIC
4Always follow the format
5layOutProblem
6options
7groundwork
8inference
9conclusion
10
11Explain the problem or question in detail.
12Place it between <layOutProblem> and </layOutProblem>
13
14List different strategies or paths you might take to solve the problem.
15Place it between <options> and </options>
16
17Note important facts, formulas, or references needed. Establish constraints.
18Place it between <groundwork> and </groundwork>
19
20Think about the problem and provide your working out.
21Place it between <inference> and </inference>.
22
23Then, provide your solution between <conclusion> and </conclusion>
24
25"""
26system_prompt1system_prompt = \
2messages = [
3 {"role": "system", "content": system_prompt},
4 {"role": "user", "content": "A triangle has sides 13, 14, and 15. Find the radius of its circumcircle."},
5]
6
7text = tokenizer.apply_chat_template(
8 messages,
9 add_generation_prompt = True,
10 tokenize = False,
11)
12from transformers import TextStreamer
13_ = model.generate(
14 **tokenizer(text, return_tensors = "pt").to("cuda"),
15 max_new_tokens = 1024,
16 temperature = 1.0, top_p = 0.95, top_k = 64,
17 streamer = TextStreamer(tokenizer, skip_prompt = True),
18)
19system_prompt1<layOutProblem>
2The problem asks us to find the radius of the circumcircle of a triangle with sides of length 13, 14, and 15. The circumcircle is the circle that passes through all three vertices of the triangle. The radius of the circumcircle is often denoted by *R*. We are given the lengths of the three sides of the triangle, and we need to determine the radius of the circle that circumscribes it.
3</layOutProblem>
4
5<options>
61. **Use the formula R = abc / 4K**, where a, b, and c are the side lengths and K is the area of the triangle. This requires us to first calculate the area of the triangle. We can use Heron's formula to find the area.
72. **Use the Law of Sines:** a/sin(A) = b/sin(B) = c/sin(C) = 2R. This requires us to find one of the angles of the triangle, which can be done using the Law of Cosines.
83. **Coordinate Geometry:** Place the triangle on a coordinate plane and find the circumcenter, then calculate the distance from the circumcenter to any vertex. This is generally more complex.
9</options>
10
11<groundwork>
12* **Heron's Formula:** For a triangle with sides a, b, and c, the area K is given by K = sqrt(s(s-a)(s-b)(s-c)), where s is the semi-perimeter, s = (a+b+c)/2.
13* **Law of Cosines:** c² = a² + b² - 2ab*cos(C)
14* **Law of Sines:** a/sin(A) = b/sin(B) = c/sin(C) = 2R
15* **Circumradius Formula:** R = abc / 4K
16* **Side lengths:** a = 13, b = 14, c = 15
17* **Constraint:** The radius must be a positive real number.
18</groundwork>
19
20<inference>
21Let's use the formula R = abc / 4K. First, we need to find the area K using Heron's formula.
22The semi-perimeter s = (13 + 14 + 15) / 2 = 42 / 2 = 21.
23Now, we can calculate the area K:
24K = sqrt(21(21-13)(21-14)(21-15)) = sqrt(21 * 8 * 7 * 6) = sqrt(3 * 7 * 2³ * 7 * 2 * 3) = sqrt(2⁴ * 3² * 7²) = 2² * 3 * 7 = 4 * 21 = 84.
25Now we can find the circumradius R:
26R = (13 * 14 * 15) / (4 * 84) = (13 * 14 * 15) / 336 = (13 * 2 * 7 * 3 * 5) / (2⁴ * 3 * 7) = (13 * 5) / 8 = 65 / 8 = 8.125
27
28</inference>
29
30<conclusion>
31The radius of the circumcircle is 65/8 or 8.125.
32</conclusion>