New puzzles and improved hints (WIP) - #48
Open
atorch wants to merge 4 commits into
Open
Conversation
- Bump minSdkVersion from 19 to 21 - Migrate mXparser from v4.2.0 (local JAR) to v6.1.0 (Maven) - Update AndroidX libraries to latest stable versions - Update Kotlin from 1.7.10 to 2.2.20 - Add comprehensive test coverage for math parser functionality
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the app’s supported answer formats (via updated mXparser and new unit tests), and updates user-facing hint text. It also upgrades several Android dependencies and raises the app’s minimum supported Android version.
Changes:
- Expanded
AnswerCheckertest coverage for combinations, constants (e, pi), percentages, and equivalent expression formats. - Updated intro/hint strings (including noting the newer mXparser version and adding a longer explanation to one hint).
- Updated Android dependencies (including mXparser via Maven) and raised
minSdkVersionto 21.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| app/src/test/java/atorch/statspuzzles/AnswerCheckerTest.java | Adds many new AnswerChecker correctness tests; minor formatting issue found. |
| app/src/main/res/values/strings.xml | Updates intro text to reflect mXparser 6.1.0 and expands a hint explanation. |
| app/build.gradle | Switches to Maven mXparser 6.1.0, upgrades AndroidX/Material/Kotlin stdlib versions, and raises minSdkVersion to 21. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @Test | ||
| public void testIncorrectAnswer() { | ||
| assertEquals(AnswerChecker.Result.INCORRECT, AnswerChecker.checkAnswer("1", "2")); | ||
| assertEquals(AnswerChecker.Result.INCORRECT, AnswerChecker.checkAnswer("0.50", "0.49")); |
| defaultConfig { | ||
| applicationId "atorch.statspuzzles" | ||
| minSdkVersion 19 | ||
| minSdkVersion 21 |
atorch
commented
Aug 5, 2026
| <item>If everyone were gay the answer would be 0.9, while if everyone were straight the answer would be 0.1. In the situation we\'re thinking about, the answer is a weighted average of those two numbers. Do you understand why?</item> | ||
| <item>If everyone were gay the answer would be 0.9, while if everyone were straight the answer would be 0.1. In the situation we\'re thinking about, the answer is a weighted average of those two numbers. Do you understand why? The reason Susie overestimates by so much is that the gay population is rare: even though she mislabels only 10\% of the (very common) straight people, that small slice is huge compared to the (few) gay people, so it badly inflates her count. What\'s fun is that the very same phenomenon turns up in a setting that looks completely unrelated — see https://research.fs.usda.gov/treesearch/31722 for the classic paper. It\'s about estimating land cover from satellite imagery, which seems a world away from a puzzle about gay and straight people, and yet the same concept explains both: if you misclassify even a tiny fraction of a common category (say, forest), and mistake it for a rare category, that will cause you to over-estimate the prevalence of the rare group.</item> | ||
| <item>A straightforward way to calculate the probability that one die beats another is to condition on the outcome of one of their rolls. For example, if the red die comes up 2, there\'s a 0/3 chance that it will beat blue; but if it comes up 4, it has a 1/3 chance. What if red comes up 9? Do you see how taking an average of those conditional probabilities will give you the correct answer? See https://en.wikipedia.org/wiki/Intransitive_dice and http://singingbanana.com/dice/article.htm for a detailed explanation.</item> | ||
| <item>A first hint is to show how life expectancy at birth was calculated: 0.2*(1 + 6 + 20 + 50 + 80) = 31.4. How can you modify that to get the answer we\'re looking for? Conditional on surviving to age 30, the probability of dying before age 30 must be zero. What about the (conditional) probability of dying between age 70 and 90? The numbers in this puzzle are made up, but they are intended to be semi-realistic -- see https://www.bbc.com/future/article/20181002-how-long-did-ancient-people-live-life-span-versus-longevity for a more detailed discussion of life spans in ancient Rome.</item> |
Owner
Author
There was a problem hiding this comment.
note to self: dog years as another easy or moderate puzzle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.