Skip to main content
Log in

On the average time complexity of computation with random partition

  • Regular Paper
  • Published:
Computing Aims and scope Submit manuscript

Abstract

Some computations are based on structures of random partition. They take an n-size problem as input, then break this problem into sub-problems of randomized size, execute calculations on each sub-problems and combine results from these calculations at last. We propose a combinatorial method for analyzing such computations and prove that the averaged time complexity is in terms of Stirling numbers of the second kind. The result shows that the average time complexity is decreased about one order of magnitude compared to that of the original solution. We also show two application cases where random partition structures are applied to improve performance.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Algorithm 1
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

References

  1. Chakraborty M, Mehera R, Pal RK (2022) Divide-and-conquer based all spanning tree generation algorithm of a simple connected graph. Theor Comput Sci 900:35–52

    Article  MathSciNet  Google Scholar 

  2. Rubing H, Weifeng S, Haibo C, Chenhui C, Ning Y (2022) A nearest-neighbor divide-and-conquer approach for adaptive random testing. Sci Comput Program 215:102743

    Article  Google Scholar 

  3. Feng Y, Kai S, Liang G, Wei X (2022) DCLF: a divide-and-conquer learning framework for the predictions of steel hardness using multiple alloy datasets. Mater Today Commun 30:103195

    Article  Google Scholar 

  4. Shubham, Prakash S, Ganapathi P (2022) An algorithm for the sequence alignment with gap penalty problem using multiway divide-and-conquer and matrix transposition. Inf Process Lett 173:106166

    Article  MathSciNet  Google Scholar 

  5. Ying Z, Chenze H, Qingbiao Z (2023) HaSGP: an effective graph partition method for heterogeneous-aware. Computing 105:455–481

    Article  MathSciNet  Google Scholar 

  6. Wilf HS (1983) Three problems in combinatorial asymptotics. J Combin Theory Ser A 35:199–207

    Article  MathSciNet  Google Scholar 

  7. Corteel S, Pittel B, Savage CD, Wilf HS (1999) On the multiplicity of parts in a random partition. Random Struct Algorithms 35(2):185–197

    Article  MathSciNet  Google Scholar 

  8. Goh WMY, Hitczenko P (2008) Random partitions with restricted part sizes. Random Struct Algorithms 32(4):440–462

    Article  MathSciNet  Google Scholar 

  9. Fatkullin I, Xue J (2021) Limit shapes for Gibbs partitions of sets. J Stat Phys 183:22

    Article  ADS  MathSciNet  Google Scholar 

  10. Czédli G, Oluoch L (2020) Four-element generating sets of partition lattices and their direct products. Acta Sci Math 86:405–448

    Article  MathSciNet  Google Scholar 

  11. Dalal AJ, Lohss A, Parry D (2021) Statistical structure of concave compositions. Ann Comb 25:729–756

    Article  MathSciNet  Google Scholar 

  12. Comtet L (1974) Advanced combinatorics: the art of finite and infinite expansions. Springer, Dordrecht, pp 15–16

    Book  Google Scholar 

  13. Branson D (2006) Stirling number representations. Discrete Math 306:478–494

    Article  MathSciNet  Google Scholar 

  14. El-Mikkawy MEA (2004) A note on the Stirling matrix of the second kind. Appl Math Comput 151:147–151

    Article  MathSciNet  Google Scholar 

  15. Cheon G-S, Kim J-S (2001) Stirling matrix via pascal matrix. Linear Algebra Appl 329:49–59

    Article  MathSciNet  Google Scholar 

  16. Manob AH, Islam TM, Parvez MT, Kaykobad M (2004) Search trees and Stirling numbers. Comput Math Appl 48:747–754

    MathSciNet  Google Scholar 

  17. Adell JA (2022) Probabilistic Stirling numbers of the second kind and applications. J Theor Probab 35:636–652

    Article  MathSciNet  Google Scholar 

  18. Belbachir H, Boutiche MA, Medjerredine A (2018) Enumerating some stable partitions involving Stirling and r-Stirling numbers of the second kind. Mediterr J Math 15:87

    Article  MathSciNet  Google Scholar 

  19. Godland T, Kabluchko Z (2021) Angle sums of schläfli orthoschemes. Discrete Comput Geom 68:125–164

    Article  Google Scholar 

  20. Kargın L, Çay E (2022) Semiorthogonality of geometric polynomials. Mediterr J Math 19:129

    Article  MathSciNet  Google Scholar 

  21. ESRI Shapefile Technical Description (1998) Environmental Systems Research Institute, Inc. https://www.esri.com/content/dam/esrisites/sitecore-archive/Files/Pdfs/library/whitepapers/pdfs/shapefile.pdf

  22. Liao MX, Fan ZH, Xin HX (2008) Quick algorithm for reconstructing line object adjacency. Comput Appl 28(1):245–247 (in Chinese)

    Google Scholar 

  23. He J, Liao MX, Hu XH, He XX (2010) Multi-level spatial hashing approach for conflict detection in air traffic management. In: The proceeding of the 2010 IRAST international congress on computer applications and computational science, pp 794–798

Download references

Acknowledgements

We thank Prof. Dong Shen from Renmin University of China for his review on the derivation part of this paper.

Funding

This work is partly supported by National Key R &D Program of China: 2022ZD0116406.

Author information

Authors and Affiliations

Authors

Contributions

ML is responsible for the following aspects: Conceptualization, methodology, software, writing original draft preparation, visualization, investigation, supervision, software, validation, writing—reviewing and editing. PL is responsible for the following aspects: Funding acquisition, Reviewing through the revision

Corresponding author

Correspondence to Mingxue Liao.

Ethics declarations

Conflict of interest

All authors declare that they have no conflict of interest.

Ethics approval

Not applicable.

Consent to participate

Not applicable.

Consent for publication

Not applicable.

Availability of data and materials

Not applicable.

Code availability

Not applicable.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendices

Appendix 1: Proof of Theorem 2

Proof

Among all solutions \([x_1,x_2, \ldots ,x_b ]\), for all i, there are the same occurrences for \( x_i = k\). In other words, if there are X solutions where \(x_i = k\) then there are also X solutions where \(x_j = k,j \ne i\) because the chances for a value to occur anywhere are the same.

Suppose the value of \(x_i\) is k, then all \(x_j (j \ne i)\) constitutes an answer for\(\sum \nolimits _{i = 1}^{b - 1} {x_i } = n - k\). With Proposition 1, the occurrences for \(x_i = k\) are \( \left( \begin{array}{l} n - k + b - 1 - 1 \\ b - 1 - 1 \\ \end{array} \right) = \left( \begin{array}{l} n - k + b - 2 \\ b - 2 \\ \end{array} \right) \), then Theorem 2 follows. \(\square \)

Appendix 2: Proof of Theorem 3

Proof

Let \( \lambda _m (x) = \sum \nolimits _{k = 0}^\infty {\frac{{k^m }}{{(1 + r)^{k + 1} }}x^{k - 1} } \), computing the integral we have:

$$\begin{aligned} \frac{1}{x}\int _0^x {\lambda _m dx} = \sum \limits _{k = 0}^\infty \frac{{k^{m - 1} }}{{(1 + r)^{k + 1} }}x^{k - 1} = \lambda _{m - 1} \end{aligned}$$

So \(\lambda _1 = \sum \nolimits _{k = 0}^\infty {\frac{k}{{(1 + r)^{k + 1} }}x^{k - 1} } \), computing the integral we get \(\int _0^x {\lambda _1 dx} = \sum \nolimits _{k = 0}^\infty {\frac{1}{{(1 + r)^{k + 1} }}x^k } = \frac{1}{{1 + r - x}} \).

Based on the above analysis we have \(\left\{ \begin{array}{l} \lambda _1 = \frac{1}{{(1 + r - x)^2 }} \\ \lambda _m = (x\lambda _{m - 1} )' \\ \end{array} \right. \).

With mathematical induction method, we now show

$$\begin{aligned} \lambda _m = \sum \limits _{k = 1}^m {S(m,k)x^{k - 1} \lambda _1 ^{(k - 1)} } \end{aligned}$$
(19)

Obviously, Eq. (19) holds for \(m=1\), that is \(\lambda _1 =\sum \nolimits _{k = 1}^1 {S(m = 1,k)x^{k - 1} \lambda _1 ^{(k - 1)}}\).

Suppose (19) holds for m, then:

$$\begin{aligned} \begin{array}{l} \lambda _{m + 1} = (x\lambda _m )' = \lambda _m + x\lambda _m ' \\ = \sum \limits _{k = 1}^m {S(m,k)x^{k - 1} \lambda _1 ^{(k - 1)} } + \sum \limits _{k = 1}^m {S(m,k)[(k - 1)x^{k - 1} \lambda _1 ^{(k - 1)} + } x^k \lambda _1 ^{(k)} ] \\ = \sum \limits _{k = 1}^m {kS(m,k)x^{k - 1} \lambda _1 ^{(k - 1)} } + \sum \limits _{k = 1}^m {S(m,k)x^k \lambda _1 ^{(k)} } \\ = \sum \limits _{k = 1}^m {kS(m,k)x^{k - 1} \lambda _1 ^{(k - 1)} } + \sum \limits _{k = 2}^{m + 1} {S(m,k - 1)x^{k - 1} \lambda _1 ^{(k - 1)} } \\ = \lambda _1 + \sum \limits _{k = 2}^m {S(m + 1,k)x^{k - 1} \lambda _1 ^{(k - 1)} + } x^m \lambda _1 ^{(m)} \\ = \sum \limits _{k = 1}^{m + 1} {S(m + 1,k)x^{k - 1} \lambda _1 ^{(k - 1)} } \\ \end{array} \end{aligned}$$

Thus (19) follows.

Let \(x=1\), from (19) we have

$$\begin{aligned} \lambda _m (x = 1) = \sum \limits _{k = 1}^m {S(m,k) \lambda _1 ^{(k - 1)} } \vert _{x = 1}. \end{aligned}$$
(20)

We now can show that

$$\begin{aligned} \lambda _1 ^{(m)} = \frac{{(m + 1)!}}{{(1 + r - x)^{m + 2} }} \end{aligned}$$
(21)

and thus

$$\begin{aligned} \lambda _1 ^{(m)} (x = 1) = \frac{{(m + 1)!}}{{(1 + r - x)^{m + 2} }} = \frac{{(m + 1)!}}{{r^{m + 2} }}. \end{aligned}$$
(22)

Using the mathematical induction method as above, we know (21) holds for \(m=0\), that is \(\lambda _1 ^{(m = 0)} =\frac{{(0 + 1)!}}{{(1 + r - x)^{0 + 2} }} \).

Suppose \(\lambda _1 ^{(m)} = \frac{{(m + 1)!}}{{(1 + r - x)^{m + 2} }}\), then \(\lambda _1 ^{(m + 1)} = (\lambda _1 ^{(m)} )' = \frac{{(m + 1 + 1)!}}{{(1 + r - x)^{m + 1 + 2} }} \). Equation (21) follows and (22) also holds if we let \(x=1\) in (21).

Therefore, based on (22), there is an induction:

$$\begin{aligned} \mathop {\lim }\limits _{n \rightarrow \infty } R(n,r,m)&= \mathop {\lim }\limits _{n \rightarrow \infty } r^2 \sum \limits _{k = 0}^n {\frac{{k^m }}{{(1 + r)^{k + 1} }}} \nonumber \\&= r^2 \sum \limits _{k = 1}^m {S(m,k)\lambda _1 ^{(k - 1)} } \vert _{x = 1} = \sum \limits _{k = 1}^m \frac{{S(m,k)k!}}{{r^{k - 1} }}. \end{aligned}$$
(23)

Theorem 3 follows. The proof is completed. \(\square \)

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Liao, M., Lv, P. On the average time complexity of computation with random partition. Computing 106, 741–758 (2024). https://doi.org/10.1007/s00607-023-01242-1

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00607-023-01242-1

Keywords

Mathematics Subject Classification

Navigation