Merged and remaining weighted means
Merged and remaining weighted means
For disjoint groups use m=1 to merge them. For m=−1 the first group is the whole and the second is a subgroup removed from it. Given the two weights and means below, find the new mean and total.
- 83 bytes
- COMP mode
Worked examples
Example 1
Original exercise 1. For disjoint groups use m=1 to merge them. For m=−1 the first group is the whole and the second is a subgroup removed from it. Given the two weights and means below, find the new mean and total. Data: M=m (1 / −1) = 1; A=n₁, count = 14; B=μ₁, mean = 28000; C=n₂, count = 6; D=μ₂, mean = 35000.
- (a)Calculate all requested quantities in the stated order. Output order: mean; total.
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data. w=n₁+mn₂; S=n₁μ₁+mn₂μ₂.
- Written solution: S₁=14×28000=392000; S₂=6×35000=210000.
- w=14+(1)×6=20; S=S₁+(1)S₂=602000.
- μ=S/w=602000/20=30100; μw=602000.
- Retain exact fractions in written work; round only the final answer.
Example 2
Original exercise 2. For disjoint groups use m=1 to merge them. For m=−1 the first group is the whole and the second is a subgroup removed from it. Given the two weights and means below, find the new mean and total. Data: M=m (1 / −1) = -1; A=n₁, count = 48; B=μ₁, mean = 67; C=n₂, count = 12; D=μ₂, mean = 55.
- (a)Calculate all requested quantities in the stated order. Output order: mean; total.
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data. w=n₁+mn₂; S=n₁μ₁+mn₂μ₂.
- Written solution: S₁=48×67=3216; S₂=12×55=660.
- w=48+(-1)×12=36; S=S₁+(-1)S₂=2556.
- μ=S/w=2556/36=71; μw=2556.
- Retain exact fractions in written work; round only the final answer.
Example 3
Original exercise 3. For disjoint groups use m=1 to merge them. For m=−1 the first group is the whole and the second is a subgroup removed from it. Given the two weights and means below, find the new mean and total. Data: M=m (1 / −1) = -1; A=n₁, count = 36; B=μ₁, mean = 50; C=n₂, count = 4; D=μ₂, mean = 46.
- (a)Calculate all requested quantities in the stated order. Output order: mean; total.
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data. w=n₁+mn₂; S=n₁μ₁+mn₂μ₂.
- Written solution: S₁=36×50=1800; S₂=4×46=184.
- w=36+(-1)×4=32; S=S₁+(-1)S₂=1616.
- μ=S/w=1616/32=101/2; μw=1616.
- Retain exact fractions in written work; round only the final answer.
When to use it
For disjoint groups use m=1 to merge them. For m=−1 the first group is the whole and the second is a subgroup removed from it. Given the two weights and means below, find the new mean and total.
Input order
- M=m (1 / −1)
- A=n₁, count
- B=μ₁, mean
- C=n₂, count
- D=μ₂, mean
- Every displayed input is required unless a blank is explicitly specified. Empty EXE keeps a stored value, whereas typing 0 replaces it with zero. The listed domain conditions must be checked even when the program does not test all of them.
Output order
- mean
- total
- Record the value and press EXE.
- The program has ended. Press AC to leave; EXE runs it again.
Conditions and limitations
- m∈{1,−1}; n₁>0; n₂>0; n₁+mn₂>0.
- n₁,n₂∈ℤ (>0) / n₁,n₂∈ℝ (>0); μ₁,μ₂∈ℝ.
- m=−1 ⇒ n₁>n₂.
- Math ERROR: m∉{1,−1} / n₁≤0 / n₂≤0 / n₁+mn₂≤0.
- Every displayed input is required unless a blank is explicitly specified. Empty EXE keeps a stored value, whereas typing 0 replaces it with zero. The listed domain conditions must be checked even when the program does not test all of them.
- Use consistent units throughout.
- Finite precision can lose small differences between large numbers or probabilities extremely near 0 or 1. An error marker is never a valid answer.
Checking access…