# Q2(b) Fuzzy washing-machine controller [10]

Subject: Intelligent Systems II

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/is2/#tee/papers/paper-2024-reexam/q2b

Canonical: https://deep-learning-study-room.vercel.app/read/is2/tee/papers/paper-2024-reexam--q2b/

Actual historical paper ·100 marks attempted /140 offered · Q1 compulsory + any four of Q2–Q7. Source defects and solution assumptions are explicitly identified.

**Question. Q2(b)** [10 marks · 2024-06-25]

Design a domestic washing-machine controller with Dirt and Grease inputs, both 0–100, and Wash time output 0–100. Use low/medium/high input terms and very short/short/medium/high/very high output terms. Derive rules, support the design with graphs and show that larger dirt gives longer wash time. Defuzzify for Dirt=60% and Grease=70%.

### Answer

#### Given

Dirt=60, Grease=70; ranges 0–100; three input terms and five output terms.

#### To find

A complete controller: membership graphs, rules, inference and crisp output.

#### Formula and why it applies

Fuzzification translates measured values into degrees. Min implements AND, max combines rules, and centroid converts the fuzzy output to one numerical command.



$$
\alpha_r=\min(\mu_{A_r}(x),\mu_{B_r}(y)),\quad z^*=\frac{\int z\mu_{out}(z)\,dz}{\int\mu_{out}(z)\,dz}
$$



#### Solution

**Source / assumption note.** This is a design question: membership coordinates, full rule table and decision threshold are not prescribed. The following is one explicitly specified valid Mamdani design, not the only possible numerical output. Never copy its result if you choose different triangles or rules.

##### Step 1. Specify the inputs and output

Dirt and Grease each span 0–100. Use low=left shoulder (0,0,50), medium=triangle (0,50,100), high=right shoulder (50,100,100). Output is wash-time index on 0–100; larger means longer washing. The question gives no physical time unit, so do not invent minutes.

Swipe across the diagram to read its labels ↔

![Explicit design assumption: overlapping low, medium and high input memberships, covering the full 0–100 range.](https://deep-learning-study-room.vercel.app/is2/fig/legacy24-wash-inputs.c512a5765f.svg)

Diagram: Explicit design assumption: overlapping low, medium and high input memberships, covering the full 0–100 range.. Labels: Explicit design assumption: overlapping low, medium and high input memberships, covering the full 0–100 range. | 0 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 0 | 0.25 | 0.5 | 0.75 | 1 | Low | Medium | High | μ(x)

Explicit design assumption: overlapping low, medium and high input memberships, covering the full 0–100 range.

Swipe across the diagram to read its labels ↔

![Five assumed output descriptors. Endpoint descriptors are shoulders, so 0 and 100 remain covered.](https://deep-learning-study-room.vercel.app/is2/fig/legacy24-wash-outputs.bb86080be7.svg)

Diagram: Five assumed output descriptors. Endpoint descriptors are shoulders, so 0 and 100 remain covered.. Labels: Five assumed output descriptors. Endpoint descriptors are shoulders, so 0 and 100 remain covered. | 0 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 0 | 0.25 | 0.5 | 0.75 | 1 | Very short | Short | Medium | High | Very high | μ(x)

Five assumed output descriptors. Endpoint descriptors are shoulders, so 0 and 100 remain covered.

##### Step 2. Define all nine IF–THEN rules

| Dirt / Grease | Low | Medium | High |
| --- | --- | --- | --- |
| Low | Very short | Short | Medium |
| Medium | Short | Medium | High |
| High | Medium | High | Very high |

Greater dirt or grease never reduces the rule consequent. This implements the requested monotonic relationship.

##### Step 3. Fuzzify the two crisp readings

| Input | Low membership | Medium membership | High membership |
| --- | --- | --- | --- |
| Dirt=60 | 0 | 4/5 | 1/5 |
| Grease=70 | 0 | 3/5 | 2/5 |

For Dirt=60: low=max(0,(50−60)/50)=0; medium=(100−60)/50=0.8; high=max(0,(60−50)/50)=0.2. For Grease=70: low=0, medium=(100−70)/50=0.6, high=(70−50)/50=0.4.

##### Step 4. Fire every active rule with minimum

| Dirt | Grease | AND strength | Output descriptor |
| --- | --- | --- | --- |
| Medium | Medium | min(0.8, 0.6) = 0.6 | Medium |
| Medium | High | min(0.8, 0.4) = 0.4 | High |
| High | Medium | min(0.2, 0.6) = 0.2 | High |
| High | High | min(0.2, 0.4) = 0.2 | Very high |

The other rules have a zero antecedent membership and therefore fire at zero.

##### Step 5. Aggregate rules and clip each output membership

| Descriptor | Maximum firing strength |
| --- | --- |
| Very short | 0.0 |
| Short | 0.0 |
| Medium | 0.6 |
| High | 0.4 |
| Very high | 0.2 |



$$
\mu_{out}(z)=\max_r\min(\alpha_r,\mu_{B_r}(z))
$$



Swipe across the diagram to read its labels ↔

![Clipped consequents are combined using maximum; overlapping areas are counted once for the centroid.](https://deep-learning-study-room.vercel.app/is2/fig/legacy24-wash-aggregate.b750073d41.svg)

Diagram: Clipped consequents are combined using maximum; overlapping areas are counted once for the centroid.. Labels: Clipped consequents are combined using maximum; overlapping areas are counted once for the centroid. | 0 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 0 | 0.25 | 0.5 | 0.75 | 1 | Aggregated output | μ(x)

Clipped consequents are combined using maximum; overlapping areas are counted once for the centroid.

##### Step 6. Calculate centroid area and first moment

Split the upper outline at every corner and intersection. On a segment [a, b] with endpoint heights u and v, integrate the straight line. This counts overlap once.



$$
A=(b-a)\frac{u+v}{2},\qquad M=aA+\frac{(b-a)^2(u+2v)}6,\qquad z^*=\frac{\sum M}{\sum A}
$$



| Segment [a, b] | Heights [u, v] | Area A | Moment M |
| --- | --- | --- | --- |
| [25, 40] | [0, 0.6] | 4.500000 | 157.500000 |
| [40, 50] | [0.6, 0.6] | 6.000000 | 270.000000 |
| [50, 60] | [0.6, 0.6] | 6.000000 | 330.000000 |
| [60, 65] | [0.6, 0.4] | 2.500000 | 155.833333 |
| [65, 75] | [0.4, 0.4] | 4.000000 | 280.000000 |
| [75, 80] | [0.4, 0.4] | 2.000000 | 155.000000 |
| [80, 90] | [0.4, 0.4] | 4.000000 | 340.000000 |
| [90, 95] | [0.4, 0.2] | 1.500000 | 138.333333 |
| [95, 100] | [0.2, 0.2] | 1.000000 | 97.500000 |



$$
z^*=\frac{1924.166667}{31.500000}\approx 61.084656
$$



##### Step 7. Demonstrate the longer-wash response

Hold grease fixed at 70 and repeat the same minimum, maximum and centroid steps for three dirt readings. This compares outputs without changing the rules or membership graphs.

| Dirt | Grease | Exact centroid | Wash-time index |
| --- | --- | --- | --- |
| 20 | 70 | 1925/41 | 46.951220 |
| 60 | 70 | 11545/189 | 61.084656 |
| 80 | 70 | 6580/99 | 66.464646 |

The calculated wash-time index increases from 46.951220 to 61.084656 to 66.464646 as dirt rises from 20 to 60 to 80. These comparisons demonstrate the requested behavior for the stated test inputs. At the target reading (60,70), only medium, high and very-high consequents fire.

**Final answer.** With the stated membership functions and rules, the output is 61.084656 on the given 0–100 scale.
