You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- $\begingroup$ Hi! 1) Your code is wrong. A single 'off' letter should not cause $\chi^2 = \infty $. Remember that it's a stochastic measure. 2) Greek is not English. 3) Non printable characters are not English. $\endgroup$Paul Uszak– Paul Uszak2019-03-03 13:25:10 +00:00Commented Mar 3, 2019 at 13:25
- 1$\begingroup$ im aware of these issues. but since i don't have frequency data for the remaining bytes i cant think of a better reasonable solution than assuming their frequency is 0 resulting in the fraction in chi square becoming infinite (or undefined with another interpretation of positive value/0) english text may very well contain nonenglish characters. your comment would be an example for that. $\endgroup$nahema– nahema2019-03-03 13:51:01 +00:00Commented Mar 3, 2019 at 13:51
- $\begingroup$ In entropy calculations for files like Shakespeare, we simply drop any characters we don't like. That eliminates f(char) = 0. We also convert all printable text to upper case. And $\chi$ isn't English, it's maths drawn in ink. As is $\int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x$. Remember that a single metric like chi is a very broad brush approach and therefore you have to compromise (a lot). Just some observations... $\endgroup$Paul Uszak– Paul Uszak2019-03-03 14:09:30 +00:00Commented Mar 3, 2019 at 14:09
- $\begingroup$ docs.scipy.org/doc/scipy/reference/generated/… $\endgroup$Paul Uszak– Paul Uszak2019-03-03 14:11:11 +00:00Commented Mar 3, 2019 at 14:11
- 1$\begingroup$ @PaulUszak $\chi$ is a greek letter (and therefore an example of a non-english character appearing in an english sentence). It is not an $x$. $\endgroup$Ella Rose– Ella Rose2019-03-03 14:26:59 +00:00Commented Mar 3, 2019 at 14:26
| Show 2 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
- MathJax equations
$\sin^2 \theta$
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. public-key), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you