Skip to content

Commit

Permalink
moves Shannon line boolean attribute behind 5 As rather than 4, since…
Browse files Browse the repository at this point in the history
… it's a pretty dubious attribute at this point
  • Loading branch information
sts10 committed May 9, 2023
1 parent 67ab0ca commit 0a6a78b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tidy"
version = "0.2.90"
version = "0.2.91"
authors = ["sts10 <[email protected]>"]
edition = "2021"
license = "MIT"
Expand Down
22 changes: 12 additions & 10 deletions src/display_information/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,18 @@ pub fn display_list_information(
list_length <= g.pow(shortest_word_length)
);

// In 1951, Claude Shannon estimated that English words only have
// about 2.6 bits of entropy per character, rather than (roughly) 4.7 bits per character.
// https://www.princeton.edu/~wbialek/rome/refs/shannon_51.pdf
// Thus, this is a more difficult line for a given list to pass above than
// the "brute force" line described above.
let g: f64 = 6.1; // 2**2.6 is 6.1 when we maintain correct number of significant digits.
eprintln!(
"Above Shannon line? : {}",
list_length as f64 <= g.powf(shortest_word_length.into())
);
if level >= 5 {
// In 1951, Claude Shannon estimated that English words only have
// about 2.6 bits of entropy per character, rather than (roughly) 4.7 bits per character.
// https://www.princeton.edu/~wbialek/rome/refs/shannon_51.pdf
// Thus, this is a more difficult line for a given list to pass above than
// the "brute force" line described above.
let g: f64 = 6.1; // 2**2.6 is 6.1 when we maintain correct number of significant digits.
eprintln!(
"Above Shannon line? : {}",
list_length as f64 <= g.powf(shortest_word_length.into())
);
}

if level >= 2 {
eprintln!(
Expand Down

0 comments on commit 0a6a78b

Please sign in to comment.