Skip to content

Commit 8f6027e

Browse files
committed
made changes in modular calculator - Show result on window load & input variable change, Other changes
1 parent 45e7c27 commit 8f6027e

9 files changed

Lines changed: 314 additions & 106 deletions

File tree

content/exercises/graded-assignments/mathematics-1/W1GA1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
title: Mathematics for Data Science 1
33
description: Q1. Which of the following are irrational numbers❓ (a) $3^{1/3}$ (b) $(\sqrt{8}+\sqrt{2})(\sqrt{12}-\sqrt{3})$ (c) $\frac{\sqrt{18}-3}{\sqrt{2}-1}$ (d) $\frac{\sqrt{8}+\sqrt{2}}{\sqrt{8}-\sqrt{2}}$
44
weight: 1
5-
subject: programming
65
subtitle: Graded Assignment
6+
label: Week 1
77

88
categories:
99
- Mathematics Graded Assignment

content/exercises/graded-assignments/mathematics-1/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Solution for IIT Madras Course Mathematics I Garaded Assignments
44
cascade:
55
title: Mathematics I
66
subtitle: Graded Assignment
7-
label: Week 1
7+
label: Assignments
88
subject: math
99
avatar: "https://upload.wikimedia.org/wikipedia/en/6/69/IIT_Madras_Logo.svg"
1010
keywords: ["Mathematics for Data Science 1","Graded Assignment","IIT Madras"]
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: Mathematics for Data Science 1
3+
weight: 1
4+
subtitle: All Questions
5+
label: Questions
6+
categories:
7+
- Mathematics Graded Assignment
8+
---
9+
10+
11+
{{< qna/question >}}
12+
**Q:** If the slope of parabola y = ax² + bx + c, where a, b, c ∈ ℝ\{0} at points (3, 2) and (2, 3) are 31 and 14 respectively, then find the value of a.
13+
14+
---
15+
16+
### Solution Step by Step 📝
17+
18+
**Step 1: Find the derivative** 🔍
19+
20+
For parabola y = ax² + bx + c, the slope at any point is:
21+
\$ \frac{dy}{dx} = 2ax + b \$
22+
23+
**Step 2: Set up equations using given conditions** 📐
24+
25+
At point (3, 2), slope = 31:
26+
\$ 2a(3) + b = 31 \$
27+
\$ 6a + b = 31 \quad ...(equation 1) \$
28+
29+
At point (2, 3), slope = 14:
30+
\$ 2a(2) + b = 14 \$
31+
\$ 4a + b = 14 \quad ...(equation 2) \$
32+
33+
**Step 3: Solve the system**
34+
35+
From equation 1: \$ b = 31 - 6a \$
36+
37+
Substitute into equation 2:
38+
\$ 4a + (31 - 6a) = 14 \$
39+
\$ 4a + 31 - 6a = 14 \$
40+
\$ -2a = 14 - 31 \$
41+
\$ -2a = -17 \$
42+
\$ a = \frac{17}{2} = 8.5 \$
43+
44+
**Step 4: Verify**
45+
46+
If a = 8.5, then b = 31 - 6(8.5) = -20
47+
48+
Check equation 2: 4(8.5) + (-20) = 34 - 20 = 14 ✓
49+
50+
**Answer:** \$ a = \frac{17}{2} or 8.5 \$ 🎯
51+
52+
{{</ qna/question >}}
53+
54+
{{< qna/question >}}
55+
**Q:** If the slope of parabola y = ax² + bx + c, where a, b, c ∈ ℝ\{0} at points ({{< qna/variable name="a" value="3" >}}, {{< qna/variable name="b" value="2" >}}) and ({{< qna/variable name="c" value="2" >}}, {{< qna/variable name="d" value="3" >}}) are {{< qna/variable name="x" value="31" >}} and {{< qna/variable name="y" value="14" >}} respectively, then find the value of a.
56+
57+
---
58+
59+
**Solution Step by Step** 📝
60+
61+
**Step 1: Find the derivative** 🔍
62+
63+
For parabola y = ax² + bx + c, the slope at any point is:
64+
\$ \frac{dy}{dx} = 2ax + b \$
65+
66+
**Step 2: Set up equations using given conditions** 📐
67+
68+
At point (3, 2), slope = 31:
69+
70+
\$ 2a(3) + b = 31 \$
71+
\$ 6a + b = 31 \quad ...(equation 1) \$
72+
73+
At point (2, 3), slope = 14:
74+
75+
\$ 2a(2) + b = 14 \$
76+
\$ 4a + b = 14 \quad ...(equation 2) \$
77+
78+
**Step 3: Solve the system**
79+
80+
From equation 1: \$ b = 31 - 6a \$
81+
82+
Substitute into equation 2:
83+
\$ 4a + (31 - 6a) = 14 \$
84+
\$ 4a + 31 - 6a = 14 \$
85+
\$ -2a = 14 - 31 \$
86+
\$ -2a = -17 \$
87+
\$ a = \frac{17}{2} = 8.5 \$
88+
89+
**Step 4: Verify**
90+
91+
If a = 8.5, then b = 31 - 6(8.5) = -20
92+
93+
Check equation 2: 4(8.5) + (-20) = 34 - 20 = 14 ✓
94+
95+
**Answer:** \$ a = \frac{17}{2} or 8.5 \$ 🎯
96+
97+
{{</ qna/question >}}

content/exercises/graded-assignments/statistics-1/week-4-questions.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ categories:
1313

1414
| Dealer's Location | OnePlus | BBK Electronics |
1515
| :-- | :-- | :-- |
16-
| Chennai | {{< qna/input name="a" value="2" >}} | {{< qna/input name="b" value="2" >}} |
17-
| Punjab | {{< qna/input name="c" value="2" >}} | {{< qna/input name="d" value="2" >}} |
18-
| Chennai | {{< qna/input name="e" value="2" >}} | {{< qna/input name="f" value="2" >}} |
19-
| Punjab | {{< qna/input name="g" value="2" >}} | {{< qna/input name="h" value="2" >}} |
20-
| Chennai | {{< qna/input name="i" value="2" >}} | {{< qna/input name="j" value="2" >}} |
21-
| Punjab | {{< qna/input name="k" value="2" >}} | {{< qna/input name="l" value="2" >}} |
22-
| Chennai | {{< qna/input name="m" value="2" >}} | {{< qna/input name="n" value="2" >}} |
16+
| Chennai | {{< qna/variable name="a" value="2" >}} | {{< qna/variable name="b" value="2" >}} |
17+
| Punjab | {{< qna/variable name="c" value="2" >}} | {{< qna/variable name="d" value="2" >}} |
18+
| Chennai | {{< qna/variable name="e" value="2" >}} | {{< qna/variable name="f" value="2" >}} |
19+
| Punjab | {{< qna/variable name="g" value="2" >}} | {{< qna/variable name="h" value="2" >}} |
20+
| Chennai | {{< qna/variable name="i" value="2" >}} | {{< qna/variable name="j" value="2" >}} |
21+
| Punjab | {{< qna/variable name="k" value="2" >}} | {{< qna/variable name="l" value="2" >}} |
22+
| Chennai | {{< qna/variable name="m" value="2" >}} | {{< qna/variable name="n" value="2" >}} |
2323

2424

2525
#### 1. What is the population standard deviation of sales of OnePlus? (Enter the answer correct to 2 decimal accuracy)
@@ -31,7 +31,7 @@ $$
3131
m_x = \frac{a+c+e+g+i+k+m}{7}
3232
$$
3333

34-
{{< qna/formula label="mean" value="((a+b+c+d+e+f+g+h+i+j+k+l+m+n))/7" >}}
34+
{{< qna/formula label="mean" title="Mean = " value="((a+b+c+d+e+f+g+h+i+j+k+l+m+n))/7" >}}
3535

3636
$$
3737
\sigma_x^2 = \frac{(a - m_x)^2 + (c - m_x)^2 + (e - m_x)^2 + (g - m_x)^2 + (i - m_x)^2 + (k - m_x)^2 + (m - m_x)^2}{7}
@@ -50,11 +50,11 @@ Therefore, Population standard deviation of sales of OnePlus = $\sqrt{\sigma_x^2
5050
---
5151

5252
{{< qna/question >}}
53-
{{< qna/input name="a" value="2" >}}
54-
{{< qna/input name="b" value="3" >}}
55-
{{< qna/formula label="sum" value="a + b" >}}
53+
The value of a: {{% qna/variable name="a" value="2" %}} meters.
54+
b = {{< qna/variable name="b" value="3" >}} meters.
55+
{{< qna/formula label="sum" title="Sum of " value="a + b" >}}
5656
The sum is: {{< qna/formula-value label="sum" >}}
57-
{{< qna/formula label="average" value="sum / 2" >}}
57+
{{< qna/formula label="average" title="Average of a and b is " value="sum / 2" >}}
5858
The average is: {{< qna/formula-value label="average" >}}
5959
{{< qna/result >}}
6060
{{< /qna/question >}}

layouts/shortcodes/qna/formula.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
</div> */}}
2222

2323
{{ $label := .Get "label" | default (printf "formula_%s" $wrapper) }}
24+
{{ $title := .Get "title" | default $label }}
2425
<div>
2526
<label class="calc-label" for="formula-{{ $wrapper }}">
26-
{{ $label }}
27+
{{ $title }}
2728
</label>
2829
<span class="calc-formula" id="formula-{{ $wrapper }}" data-calc-formula="{{ .Get "value" | default "a + b" }}" data-calc-label="{{ $label }}">
2930
{{ .Get "value" | default "a + b" }}<span class="calc-formula-result"></span>

layouts/shortcodes/qna/input.html

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)