Skip to content

Error in "Compressing a string" section in "Prefix function. Knuth–Morris–Pratt algorithm" #1414

@ohwphil

Description

@ohwphil

I think "But then the string consists of only one character repeated over and over, hence we can compress it to a string of size  $1$ ..." is false. Shouldn't it be written: "But then the string consists of $gcd(p, k)$ characters repeated over and over, hence we can compress it to a string of size $gcd(p, k)$, and since it divides $p$ it also divides $n$."

Example: k = 4, n = 12, p = 6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy