Fill Random Columns 0728Fb
1. **Stating the problem:**
You want to fill columns KOLOM 1 to KOLOM 4 with random values such that the average (rata-rata) column matches the given values.
2. **Formula used:**
The average for each row is calculated as
$$\text{rata-rata} = \frac{\text{KOLOM 1} + \text{KOLOM 2} + \text{KOLOM 3} + \text{KOLOM 4}}{4}$$
3. **Important rule:**
To find the sum of the four columns for each row, multiply the average by 4:
$$\text{Sum} = 4 \times \text{rata-rata}$$
4. **Approach:**
We will generate four random integers for each row such that their sum equals the calculated sum from the average.
5. **Example for one row:**
Suppose the average is 80 for a row.
Then,
$$\text{Sum} = 4 \times 80 = 320$$
We generate four random numbers $a,b,c,d$ such that
$$a + b + c + d = 320$$
6. **General method:**
- For each row, calculate $S = 4 \times \text{rata-rata}$.
- Generate three random integers $a,b,c$ between reasonable ranges.
- Calculate $d = S - (a+b+c)$.
- Ensure $d$ is within the valid range (e.g., 0 to 100).
- If not, regenerate $a,b,c$.
7. **This ensures the average column remains consistent with the generated values.**
Since the user requested only the method and explanation, actual random values are not generated here.
Final answer: Use the formula $$\text{rata-rata} = \frac{\text{KOLOM 1} + \text{KOLOM 2} + \text{KOLOM 3} + \text{KOLOM 4}}{4}$$ and generate random values in KOLOM 1 to KOLOM 4 such that their sum equals $4 \times \text{rata-rata}$ for each row.