Skip to content

New puzzles and improved hints (WIP) - #48

Open
atorch wants to merge 4 commits into
masterfrom
new-puzzles-and-improved-hints-2026
Open

New puzzles and improved hints (WIP)#48
atorch wants to merge 4 commits into
masterfrom
new-puzzles-and-improved-hints-2026

Conversation

@atorch

@atorch atorch commented Jul 17, 2026

Copy link
Copy Markdown
Owner

No description provided.

atorch added 3 commits March 6, 2026 16:20
- 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AnswerChecker test 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 minSdkVersion to 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"));
Comment thread app/build.gradle
defaultConfig {
applicationId "atorch.statspuzzles"
minSdkVersion 19
minSdkVersion 21
<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 &#8212; 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>

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: dog years as another easy or moderate puzzle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants