雙向隨機生成數列的長度探討 The Expected Length of Randomly Generated Bidirectional Series
This study explores the expected length of a randomly generated sequence of numbers. There are n lots numbered 1, 2, 3, ..., n. Every time a lot is drawn, the number is written on the paper to generate a sequence. Terms can only be added to the left and right ends of the sequence, but cannot be inserted from between. If the number drawn is greater than the maximum term of the current sequence, it will be written on the right side of the current sequence. If the number drawn is smaller than the minimum term of the current sequence, it will be written on the left side of the current sequence. If the number drawn is between the minimum and maximum items of the current sequence, the operation is terminated. Based on this idea, the researcher divided the sequence into two categories: "unidirectional sequence" and "bidirectional sequence" according to the direction of adding terms. As the name implies, the unidirectional sequence can only extend to one end (this study discusses extension to the right without loss of generality), while the bidirectional sequence can extend to both left and right ends. In addition, researchers divided the sequence into two categories: "strict increasing and decreasing" and "non-strict increasing and decreasing". According to the generation principle, strict sequence is equivalent to "draw without reset"; non-strict sequence is equivalent to "draw with reset". Under such rules, this study explores the general solution to the expected length of a unidirectional or bidirectional randomly generated sequence when n lots are drawn with or without reset, and successfully proves some identities and properties.