« first day (1464 days earlier)      last day (3378 days later) » 
00:00 - 18:0018:00 - 00:00

6:01 PM
@PeterTaylor I think another interesting challenge would be to generate tuples with uniform randomness, where tuples with repeated elements should have the same probabilities as those with unique elements.
I'm not even sure how I'd do that, short of generating all of them and picking a random one.
 
0
A: Sandbox for Proposed Challenges

Martin BüttnerShuffle an Array code-golfarray-manipulationrandompermutations The task is pretty simple: given an array of integers, shuffle it. There are a few rules though: Every possible permutation must be returned with the same probability (so the shuffle should have a uniform distribution). You must n...

 
6:25 PM
@Optimizer can I use your quine and ROT13 for CJam examples online? they're shorter than mine :)
 
sure :)
 
thanks
 
@Optimizer you found a shorter quine? O.O
 
shorter than his on the examples page.
 
there's the examples page in the wiki, and also some selectable examples at cjam.aditsu.net
 
6:27 PM
@aditsu if you're talking about the quine that uses a string instead of a block, I'd prefer if you used the 8-byte block-based one instead
the block ones are much more useful when expanding to generalised quines
wow I have never seen that example dropdown o.O
 
@MartinBüttner hmm you are right, the backtick is unnecessary.. wonder why I never noticed that
 
yeah, that's the one I've been using when I didn't need the block as a string for further processing
then again most generalised quines will build on the form with the backtick
 
well, that's 9 chars
 
with the backtick? yes
@PeterTaylor Hm, there are a few other randomness challenge ideas that sound conceptually simple but are actually a bit tricky. I'm thinking I could turn this into a series of challenges. Random permutation. Random tuples or subsets. Random (integer) partition.
 
random thought of the day :p
 
6:35 PM
lol
 
6:51 PM
hmm actually, maybe I knew the backtick wasn't needed, but used it to make it non-trivial
 
7:33 PM
@PeterTaylor okay, I think I've got ~9 ideas to potentially make a golf course from this. would you mind helping me sift through them see if some of them may have been done/have trivial shortcuts/turn out to be equivalent? (doesn't have to be today)
 
7:49 PM
help rich get richer
 
8:01 PM
your bitterness is incredible :D
it's not like anything's preventing you from writing challenges :P
 
rich blaming poor for being poor
 
8:49 PM
@randomra you're good with J, right? is there an equivalent to & and @ (tracking) for hooks and forks? basically, I'd like to write (f g) with monadic g and dyadic f, such that it automatically applies to each element in a list, without having to use "0
 
9:00 PM
still trying the scrambled keys typing ?
 
yeah
in principle I've got everything I need, but putting things together is fairly non-trivial in J ... at least to inexperienced users :D
 
so "in principal" how many bytes it is ?
 
9:22 PM
I'll post a sandbox entry for an elevator control challenge today.
 
@Optimizer I don't know, I haven't put it together into a single function yet. more than 16 though.
 
9:59 PM
Wow, we haven't had a shuffle question on its own before?
 
doesn't look like it
 
Maybe you should link to Will it Shuffle :P
 
oh sweet
 
@Sp3000 I linked three above.
 
well yeah, but they all built-ins or some other workarounds as far as I could tell
 
10:08 PM
What counts as neither a built-in or a workaround?
 
0
A: Sandbox for Proposed Challenges

KennyTMFind your Local Timezone kolmogorov-complexity code-golf (Challenge "inspired" by the now-closed Rise and Shine!.) Summary Input: Two integers, the latitude (-66 ≤ y ≤ 66), and the longitude (-179 ≤ x ≤ 179). Output: The timezone offset in the hours from UTC at the given position, on 2015 Fe...

 
@PeterTaylor implementing it via swap or randomly selecting one of the remaining elements and adding it to a new list
 
@MartinBüttner I'm not actually sure exactly what you mean by that. But it's worth bearing in mind that random combinatorial object is closely related to counting the combinatorial objects.
 
@PeterTaylor even if you put time constraints on it that rule out enumerating them?
 
I'm sure I have done shuffling in GS by randomly selecting one from the list, but that's not as easy to find as the now standard technique of shuffling by {;large_number rand}$, which I learnt from someone else. Possibly Ilmari.
Counting, not enumerating (in the sense of iterating).
 
10:12 PM
the idea is you're given a pool of numbers, say 1 1 2 2 2 3 4 5 5 6, and you're to generate a random 2-tuple (say) with uniform distribution, such that (1, 1), (1, 2), (2, 1) and (2, 2) all have the same probability
 
So filter to uniques, select one at random, select one at random?
 
well you couldn't reuse, e.g. 4 or 6... or have more than two 1s if a 3-tuple or longer is requested
 
@MartinBüttner so f has >0 rank and g has 0? and you want something like (-:"0*:)1 2 3
afaik J almost always uses the biggest rank by default except @ and &
 
@randomra basically... I've got a list of boxes, each of which contains a list of numbers (of different length)... I want to unbox each of those boxes, and perform an operation on the contained lists without all of them being expanded to fit into a single table first
 
thats not a hook, hook is f(x,g(x)), yours is f(g(x)) if I understand correctly
 
10:20 PM
Coming back to the point about the relationship between random selection and counting, one of your ideas was random partition. With the right recurrence the code to count can be easily adapted to select one at random. (It wouldn't be at all easy to adapt an analytic-combinatoric computation).
 
@randomra well, f also uses x ... actually it's more like f(x,g(h(x))) where h produces the list of boxes from x
@PeterTaylor how would you ensure the selection is uniform, though? surely you can't know the different sizes of the recursion branches up front to bias them correctly? would you run the recursion twice, once bottom-up to find the biases and then top down to determine a partition?
 
That's one way. Another is to make it so that instead of returning a count it returns a count and a partition; then when it combines them by adding the numbers it can also do a weighted random selection between the partitions.
 
oh I see
do we have a code golf for partition counting as well?
hm, can't find anything
I wouldn't call this a duplicate of that popcon then
@PeterTaylor interested in the other randomness ideas?
 
10:41 PM
Personally I'm more interested in the counting side of combinatorics.
 
well, not all of the ideas are about combinatorics :P
for instance, I couldn't find a code golf to generate random numbers from a normal distribution
 
That's not so different to codegolf.stackexchange.com/q/9070/194
Although it would allow Box-Müller.
 
I did see that one
there's also Marsaglia and probably some other ones
I figured this would allow more approaches than integrating the distribution
another idea was Poisson disc sampling
 
11:34 PM
Hullo.
 
11:59 PM
0
A: Sandbox for Proposed Challenges

PhiNotPiElevator Control [WIP] The controller is still a WIP, but I have a decent idea of how it'll work. You have been hired as a Vertical Integration Specialist (programmer) at Ascension Incorporated to write advanced elevator controller software. (backstory wip) Elevators are Cool The current setu...

 
00:00 - 18:0018:00 - 00:00

« first day (1464 days earlier)      last day (3378 days later) »