We wish to find the sum of $40$ given numbers utilizing $40$ processors. Initially, we have the number $0$ on the screen of each processor. Each processor adds the number on its screen with a number entered directly (only the given numbers could be entered directly to the processors) or transferred from another processor in a unit time. Whenever a number is transferred from a processor to another, the former processor resets. Find the least time needed to find the desired sum.
Problem
Source: Turkey NMO 1999, Problem 6
Tags: induction, combinatorics unsolved, combinatorics
25.10.2011 12:20
Let [x] be the least integer above x. We determine a way to figure out the sum with the least steps. If we use k processors at a time, we don't want 2 processors to compute the same number because after that we cannot add one processor to the other. We need to use at least [40/k] units of time to enter all the number. Let f(m) be the least times to transform m processors to 1 processor. f(m)=1+f(m/2), if m is even and f(m)=1+f((m+1)/2) if m is odd. Using induction, we have that f(m)=[log_2(m)] Therefore, we need f(k)=[\frac{40}{k}]+[log_2(k)] times. For each 2^a<k <= 2^{a+1}, the least value of f is f(2^{a+1}). So we have the least value:f(16)=f(32)=7
15.12.2024 16:14
This is the official solution: At a given moment, let the numbers not yet entered into any processor and the numbers displayed on the screens of the processors be called the "items to be processed". Let \( n(c) \) represent the number of items to be processed at the end of time unit \( c \). Initially, \( n(0) = 40 + 8 = 48 \). If the desired total has been achieved after \( \overline{c} \) time units, then \( n(\overline{c}) = 1 \). (Here, we assume, without loss of generality, that all processors are utilized.) In one time unit, a maximum of \( 8 \) operations can be performed. Additionally, in one time unit, the number of items to be processed can be reduced by at most half. Therefore: \[ n(c) - n(c+1) \leq \min \left\{ \frac{n(c)}{2}, 8 \right\}, \]or equivalently: \[ n(c+1) \geq \max \left\{ \frac{n(c)}{2}, n(c) - 8 \right\}. \] Now, consider the system defined by \( M(0) = 48 \): \[ M(c+1) = \max \left\{ \left\lceil \frac{M(c)}{2} \right\rceil, M(c) - 8 \right\}, \]where \( \lceil x \rceil \) denotes the smallest integer greater than or equal to \( x \). The smallest integer \( \overline{C} \) that satisfies the condition \( M(\overline{C}) = 1 \), and the sought value \( \hat{C} \), satisfy \( \hat{C} \geq \overline{C} \). Let's calculate \( \overline{C} \): \[ \begin{aligned} M(0) &= 48, & M(1) &= \max \left\{ \left\lceil \frac{48}{2} \right\rceil, 40 \right\} = 40; \\ M(2) &= \max \left\{ \left\lceil \frac{40}{2} \right\rceil, 32 \right\} = 32, & M(3) &= \max \left\{ \left\lceil \frac{32}{2} \right\rceil, 24 \right\} = 24; \\ M(4) &= \max \left\{ \left\lceil \frac{24}{2} \right\rceil, 16 \right\} = 16, & M(5) &= \max \left\{ \left\lceil \frac{16}{2} \right\rceil, 8 \right\} = 8; \\ M(6) &= \max \left\{ \left\lceil \frac{8}{2} \right\rceil, 0 \right\} = 4, & M(7) &= \max \left\{ \left\lceil \frac{4}{2} \right\rceil, -4 \right\} = 2; \\ M(8) &= \max \left\{ \left\lceil \frac{2}{2} \right\rceil, -6 \right\} = 1. & \end{aligned} \] Thus, \( \overline{C} = 8 \). The sought value satisfies \( \hat{C} \geq 8 \). In the diagram below, the vertices represent the processors; the triangles represent the numbers entered into the processors during the first five time units; and the directed edges show which processor's partial total is transferred to which other processor. It can be seen that the desired total can be achieved in \( 8 \) time units. Hence, \( \hat{C} = 8 \). Source: Matematik Dünyası
17.12.2024 01:01
The original version of the problem states that after the transferring the screen will be blacked-out. The translation made by ChatGPT: We want to calculate the sum of 40 numbers using 8 "processors." Initially, each processor's display shows the number 0. Any processor can add a number, either given externally or transferred from another processor, to the number currently on its display in one unit of time, and then write the resulting total on its display. A processor transferring the number on its display to another processor causes its own display to go blank (blacked out). By entering the given 40 numbers into any processors we choose and transferring the partial sums obtained by the processors to any other processor, what is the minimum number of time units required to compute the sum of these 40 numbers? I will assume that a processor with a blacked-out screen is no longer used. The reason for this assumption is that the problem does not state that a processor performing transfer operations displays `$0$` on its screen. Most likely, solving the problem does not require processors' screens to black out; however, since the problem is presented this way, I will provide a solution accordingly. If a processor receives a number from an external source, let it perform the `$L$` (load) operation. A processor receiving a number from another processor performs the `$S$` (sum) operation, while one transferring a number to another processor performs the `$T$` (transfer) operation. A processor doing nothing remains idle, performing the `$I$` (idle) operation. With `$8$` processors, the summation can be achieved in `$8$` time units (steps) as follows: - In the first `$5$` time units, `$40$` numbers are loaded into the processors. - Then, transfer operations are performed as `$2 \to 1$`, `$4 \to 3$`, `$6 \to 5$`, `$8 \to 7$`. - Next, transfers are made as `$3 \to 1$` and `$7 \to 5$`. - Finally, the transfer `$5 \to 1$` is performed. We will prove that this summation cannot be completed in fewer time units. Analysis for Different Numbers of Processors For `$p \leq 5$` processors, loading alone requires at least: \[ \left \lceil \frac{40}{p} \right \rceil \geq \frac{40}{5} = 8 \text{ time units}. \]Thus, to complete the operation in fewer than `$8$` time units, `$p=6$`, `$p=7$`, or `$p=8$` processors may be used. We will assume unused processors do not exist (i.e., they are not in the `$I$` state). Case 1: `$p=6$` Processors If we assume `$6$` processors, we need to complete `$40L$` load operations in `$7$` time units. This requires a total of: \[ 7 \times 6 = 42 \text{ operations}. \]However, even the initial partial sums require `$3S$`, `$3T$` (i.e., `$6$` operations). Therefore, the total number of operations becomes: \[ 40 + 6 > 42. \]Thus, the summation cannot be completed in `$7$` time units with `$p=6$` processors. Case 2: `$p=7$` Processors If we assume `$7$` processors, we need to complete `$40L$` load operations in `$7$` time units. This requires: \[ 7 \times 7 = 49 \text{ operations}. \]Additionally, calculating the partial sums of `$7$` processors requires `$6S$` and `$6T$` operations. The total becomes: \[ 40 + 12 > 49. \]Thus, the summation cannot be completed in `$7$` time units with `$p=7$` processors. Case 3: `$p=8$` Processors If we assume `$8$` processors, we need to complete `$40L$` load operations in `$7$` time units. This requires: \[ 7 \times 8 = 56 \text{ operations}. \]The `$8$` processors' partial sums require `$7S$` and `$7T$` operations. The total becomes: \[ 40 + 14 = 54 \text{ operations}. \]If we can identify `$3I$` idle states, we will prove that the summation cannot be completed in `$7$` time units. Assume the first transfer happens at `$t_1$`, the second at `$t_2 \geq t_1$`, and the last at `$t_7$`. Since at most `$4$` transfers can occur in a single step and no transfers can occur during the last step (to avoid re-summing partial totals), it follows that: \[ t_7 - t_1 \geq t_7 - t_2 \geq 2. \]This means the processors involved in the first two transfers remain idle for at least `$2$` steps each. Thus, we identify at least `$4I$` idle states. The total number of operations becomes: \[ (40 + 14) + 4 = 58 > 56. \]Therefore, the summation cannot be completed in `$7$` time units with `$p=8$` processors. ### Note For `$p=6$` and `$p=7$`, the `$I$` state does not need to be considered, and the assumption that a processor with a blacked-out screen is unused is unnecessary. If we can identify `$3I$` states with `$p=8$` while allowing processors performing transfers to be reused, the initial assumption can be discarded.
17.12.2024 21:43
I will also try to provide a solution for a scenario where a processor that goes dark can be used again. Solution for 8 Processors in 8 Time Units We aim to compute the sum of \(40\) numbers using \(8\) processors in the minimum possible time. Each processor can perform one operation per time unit: - Loading a number (\(L\)), - Summing two numbers (\(S\)), - Transferring a number (\(T\)), or - Remaining idle (\(I\)). --- Strategy for 8 Processors in 8 Time Units Step-by-Step Execution 1. Loading Phase (5 Time Units) - \(40\) numbers are distributed and loaded into \(8\) processors. Each processor can load one number per time unit. - With \(8\) processors, \(8\) numbers can be loaded in each time unit. - Therefore, loading all \(40\) numbers requires: \[ \lceil 40 / 8 \rceil = 5 \, \text{time units.} \] 2. Transfer Phase (3 Time Units) After loading, we reduce the active processors through transfers and summations to compute the total sum: - Step 1: Transfer numbers \(P_2 \to P_1\), \(P_4 \to P_3\), \(P_6 \to P_5\), and \(P_8 \to P_7\). \(4\) active processors remain. - Step 2: Transfer sums \(P_3 \to P_1\) and \(P_7 \to P_5\). \(2\) active processors remain. - Step 3: Transfer the sum \(P_5 \to P_1\). \(1\) processor (\(P_1\)) has the total sum. This transfer phase takes \(3\) time units. --- Total Time Required Adding the loading and transfer phases: \[ 5 \, \text{(loading)} + 3 \, \text{(transfers)} = 8 \, \text{time units.} \] --- Proof That Fewer Than 8 Time Units Is Impossible To prove that fewer than \(8\) time units is impossible, we calculate the minimum number of operations needed and show that they cannot fit into fewer than \(8\) time units with the available processors. Definitions: Let: - \(t\) = total number of time units, - \(p\) = number of different processors used in any steps, Each processor can perform \(t\) operations in \(t\) time units. With \(8\) processors, there are \(8t\) total operations available. --- Key Components of the Total Work 1. Load Operations: Loading \(40\) numbers requires exactly \(40\) operations. 2. Transfer and Summation Operations: To combine \(p\) processors into \(1\), at least \((p - 1)\) transfers and \((p - 1)\) summations are required, for a total of \(2(p - 1)\) operations. 3. Idle Operations: For the steps leading up to the final step, processors that are not actively working remain idle. - If \(p\) processors are active in a step, the remaining \(8 - p\) processors are idle for that step. - In the final step, \(6\) processors remain idle because only \(2\) are involved in a summation and/or transfer. --- Total Work Equation The total number of operations must satisfy: \[ \text{Load Operations} + \text{Transfer + Summation Operations} + \text{Idle Operations} \leq 8t \]Substituting: \[ 40 + 2(p - 1) + \text{Idle Operations} \leq 8t \] Idle Operations: Idle operations consist of at least: - \(6\) idle operations in the final step, - \((t - 1)(8 - p)\) idle operations during earlier steps. Thus, idle operations total: \[ (t - 1)(8 - p) + 6 \] Substitute back into the total work equation: \[ 40 + 2(p - 1) + (t - 1)(8 - p) + 6 \leq 8t \] --- Simplify the Equation Expand terms: \[ 40 + 2p - 2 + 8t - 8 - pt + p + 6 \leq 8t \] Combine like terms: \[ 36 + p(t - 3) \leq 8t \] Rearrange: \[ p(t - 3) \geq 36 \] --- Bounding \(t\) and \(p\): If \(t = 7\): \[ p(7 - 3) = 4p \geq 36 \implies p \geq 9 \]This is impossible because \(p \leq 8\) (only 8 processors are available). Thus, \(t \geq 8\). --- Conclusion The minimum time required to compute the sum of \(40\) numbers using \(8\) processors is: \[ \boxed{8 \, \text{time units.}} \]