Activity for trichoplax
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #287110 |
Post edited: Link to main Meta discussion |
— | 9 months ago |
Edit | Post #287207 |
Post edited: Make rule explicitly reference the test cases |
— | 9 months ago |
Comment | Post #287207 |
I'm sorry for overlooking the other question. I have now edited the challenge to state that a maximum input length of 16 characters must be supported.
This is based on the previously existing rule
> Provided your output is correct for each input, your code is valid
combined with the longest ... (more) |
— | 9 months ago |
Edit | Post #287207 |
Post edited: Be explicit about maximum input length |
— | 9 months ago |
Comment | Post #287207 |
In hindsight, it might have been better to make the input a single character, so that there is only one challenge (the conversion), separate from processing a string or other sequence type.
I will bear this in mind when designing future challenges, but I'm going to keep this challenge as it is (re... (more) |
— | 9 months ago |
Comment | Post #287207 |
Interesting question. I see that as a separate, slightly smaller, challenge. If you write code that works for a single character, then to be a valid answer here it would need to also include the code to call that for each character in the input. (more) |
— | 9 months ago |
Comment | Post #289226 |
There are a few things to note:
1. This is codegolf.codidact.com for recreational coding. For help with coding errors you can ask at software.codidact.com
1. Python's `#` for comments is interpreted as a heading in a question post. This is why all the comments show as huge text. You can make a co... (more) |
— | 9 months ago |
Comment | Post #289167 |
I can't see any problem that could be caused by having a random button on a Meta category (Codidact Meta has had one all this time with no complaints...) so personally I'm in favour of just removing the restriction and having a random sort button for every category. (more) |
— | 9 months ago |
Edit | Post #289164 | Initial revision | — | 9 months ago |
Question | — |
A random button for ordering Code Golf post lists On most Codidact communities the posts list has a "Random" button among the sorting buttons: The sorting buttons on Codidact Meta - "Activity", "Age", "Score", and "Random" The only exceptions are the Codidact Proposals community, and Code Golf: The sorting buttons on Code Golf - "Activity",... (more) |
— | 9 months ago |
Comment | Post #289011 |
Still the same length:
```ruby
->i{i.chars.sort_by{"jbdfghklpqyit".index(_1)||13}}
```
Giving up now... (more) |
— | 9 months ago |
Comment | Post #289011 |
I couldn't find a way to shorten this, just ended up with the same length. You can use `0` instead of `-1` but only if you add an extra character to the string to prevent the index ever being zero, so it costs a byte to save a byte...
```ruby
->i{i.chars.sort_by{"_tibdfghklpqyj".index(_1)||0}}
`... (more) |
— | 9 months ago |
Edit | Post #287329 |
Post edited: Reword awkward sentence |
— | 10 months ago |
Edit | Post #288943 |
Post edited: Typo |
— | 10 months ago |
Comment | Post #288943 |
Ah. I see what I missed now. Thank you.
Would the first sentence be clearer with the "of" replaced by something like "such that"?
Something like this:
> Given a number $n$ as input output the smallest number $k$ such that the modular residues of $k$ by the first $n$ primes is exactly $\\{-1,... (more) |
— | 10 months ago |
Suggested Edit | Post #288943 |
Suggested edit: Typo (more) |
helpful | 10 months ago |
Comment | Post #288943 |
To check if I've understood the requirement, does the following match the intent of the challenge?
> Given $n\ge 3$ find the smallest $k$ such that the first $n$ primes all have a multiple in $\\{k-1,k,k+1\\}$. (more) |
— | 10 months ago |
Comment | Post #288939 |
I try to post a variety of challenges so there are some that take a minute and some that require more thought. As a result I have some with no answers yet... (more) |
— | 10 months ago |
Comment | Post #288939 |
It was already clear, just didn't want you getting a downvote from someone who stopped reading before the end of the sentence. I'm probably being overcautious (more) |
— | 10 months ago |
Comment | Post #288939 |
Great to see a formula for this (even if it's not yet shorter than brute force). I tried but gave up and went with brute force to generate the test cases (which took a while to run...). (more) |
— | 10 months ago |
Comment | Post #288939 |
For anyone skim reading this answer, the phrase
> the results for $n \in \left\\{ 3, 4, 5 \right\\}$ aren't exactly zero
does not invalidate this answer. The requirement of being correct to 6 decimal places is (far more than) met. (more) |
— | 10 months ago |
Comment | Post #288914 |
That's a really intuitive explanation. I don't know APL and I still found the visualisation easy to follow with the sequence of tables. (more) |
— | 10 months ago |
Edit | Post #288848 |
Post edited: Mark as finalized |
— | 10 months ago |
Edit | Post #288917 | Initial revision | — | 10 months ago |
Question | — |
Probability of rolling all 6 dice faces The probability of rolling every number from 1 to 6 with $N$ six-sided dice. Input - A positive integer $N$. - Your code must work for inputs up to and including 10, but may crash, error, or give incorrect output for larger inputs. Output - A probability, $0 \le p \le 1$ - This is the proba... (more) |
— | 10 months ago |
Edit | Post #288848 |
Post edited: Remove ambiguity from output section |
— | 10 months ago |
Edit | Post #288848 |
Post edited: Add 10th test case |
— | 10 months ago |
Comment | Post #288914 |
Even though I've convinced myself they are equivalent, I can't visualise yours, whereas I can understand mine geometrically so it makes sense to me intuitively.
If you want the geometric interpretation of mine, $i^N-(i-1)^N$ is the number of ways of rolling $N$ dice that lead to $i$ being the high... (more) |
— | 10 months ago |
Comment | Post #288885 |
I generally default to using a numeral but it looked strange immediately after the $N$ so I went with "$N$ six-sided" rather than "$N$ 6-sided". (more) |
— | 10 months ago |
Comment | Post #288914 |
I was curious so I tried to derive your formula from mine. Managed it by unrolling the sum and then rolling it back up at the end. No idea if this is similar to how you found it.
$$\frac{1}{6^N}\sum_{i=1}^6 i(i^N-(i-1)^N)$$
$$\frac{1}{6^N}\sum_{i=1}^6 i(i)^N-i(i-1)^N$$
$$\frac{1}{6^N}\left(\... (more) |
— | 10 months ago |
Comment | Post #288914 |
I had to implement this formula and test it for myself because it looks so different from the formula I used to generate the test cases that I couldn't imagine it giving the same result - but it does!
For comparison, here's the formula I used:
$$\frac{1}{6^N}\sum_{i=1}^6 i(i^N-(i-1)^N)$$
Muc... (more) |
— | 10 months ago |
Comment | Post #288903 |
I usually try to make a reference implementation before posting a challenge, but in this case it only exists in my head (which means it's untested). At some point I'll implement it in real code and post it as an answer. It uses a more generic approach which I'm not sure will be golfy (I just needed t... (more) |
— | 10 months ago |
Comment | Post #288903 |
Glad your testing was more thorough than mine... I should probably generate the exhaustive list of test cases for testing future entries. (more) |
— | 10 months ago |
Edit | Post #288502 |
Post edited: Emphasise that label must stay the same when moved |
— | 10 months ago |
Comment | Post #288903 |
I love the detailed explanation!
I couldn't tell from the explanation whether this would still work with the shapes at different positions in the 4 by 4 input area. I adjusted some of the test cases by translating them down or to the right by adding newlines or spaces and they still work.
I als... (more) |
— | 10 months ago |
Edit | Post #288848 |
Post edited: Change test cases from 6 significant figures to 6 decimal places |
— | 10 months ago |
Comment | Post #285880 |
I notice that several of the answers show on the leaderboard with their byte count instead of the number of unique characters, which often gives them a significantly higher (worse) score. In many cases this is because the answer heading shows the unique characters and the byte count, and the leaderbo... (more) |
— | 10 months ago |
Comment | Post #288897 |
I was wondering if someone would take the brute force approach. I didn't want to rule it out so I set the maximum required input low. Even with the closed form solution that I used to generate the test cases, I couldn't go much higher without switching to arbitrary precision numbers. (more) |
— | 10 months ago |
Edit | Post #288885 |
Post edited: Remove redundant test case bullet point |
— | 10 months ago |
Edit | Post #288885 |
Post edited: Specify face values of the 6 faces of the dice |
— | 10 months ago |
Edit | Post #288848 |
Post edited: Extra mention that the dice are six-sided |
— | 10 months ago |
Edit | Post #288885 |
Post edited: Specify six-sided dice in intro following feedback |
— | 10 months ago |
Comment | Post #288885 |
Thanks for the feedback. The first point of the output section mentions "six-sided dice". I left this out of the introductory paragraph for brevity, but I'll add it in now so it's clear from the start of reading. (more) |
— | 10 months ago |
Edit | Post #288848 |
Post edited: Streamline |
— | 10 months ago |
Edit | Post #288885 |
Post edited: Specify six-sided dice |
— | 10 months ago |
Edit | Post #288805 |
Post edited: Mark as finalized |
— | 10 months ago |
Edit | Post #288885 | Initial revision | — | 10 months ago |
Question | — |
Expected value of highest dice rolled You roll $N$ six-sided dice simultaneously. Your score is the highest number rolled. If you play this game many times, what is the expected value (mean) of your score? Input - A positive integer $N$. - Your code must work for inputs up to and including 10, but may crash, error, or give incorrect... (more) |
— | 10 months ago |
Edit | Post #288805 |
Post edited: Streamline |
— | 10 months ago |
Edit | Post #282804 |
Post edited: Add finalized tag now that the sandbox can be filtered to exclude tags (this isn't really a sequence question) |
— | 10 months ago |