« first day (4352 days earlier)      last day (788 days later) » 

00:10
@Adám Oh, it seems like a pretty big con to me to have such similar names.
"Array Cast" and "APL Cast"
It could easily be confusing. And it also just starts to sounds pretty dry, imo.
00:29
@mathcat Don't worry, it's going to be a Klein Stein (a Klein bottle shaped like a stein)
@mousetail get this: it doesn't work yet
@user They're icon-theme-dependant
I have an icon browser program I use to choose them
01:00
Sandbox posts last active a week ago: KotH: Build an Organism
 
2 hours later…
03:09
@Adám Stripping leading zeroes makes sense because f(42) = f(042). That rule alone takes care of the property that f(0) = 1. Why do you strip trailing zeroes, though?
I'm presuming it's so that exponents are ignored, and scientific notation is uncomplicated, but I could still see it just being equal to zero whenever there's a trailing zero.
Either f(0.00123) = f(12300) = 6
Or f(0.00123) = f(12300) = 0
I feel like I'd have to have even the slightest sense of its application, in order to figure out which more useful, haha
By the way, what are the zeroes in .00123 called? Are those still called leading zeroes, or do they have a special name?
@AviFS Ooh, you could encode both pieces of information by making it negative if there are one or more non-leading zeroes, hehe
So f(123) = f(1.23) = f(0.123) = f(0.1230) = f(0123) = 6
But f(1230) = f(.0123) = -6
Whether or not there's a 0 in the number is arguably more useful information than whether the sign of the number is negative. It's already easy to get the sign of the number in any coding lang, but whether the number contains a 0 would actually be unique info.
03:51
@Simd Including, or not including, empty subsets?
@Simd @user I don't believe your guys' jump to a constant of (3/4) works, unless I'm missing some assumptions.
Is this given that |A| < |B|?
04:09
A ⊆ B implies A can be equal to B
@Bubbler True true, I meant |A| <= |B|.
and do you mean "|A| <= |B| is an assumption"?
Btw, I think (3/4)^n is correct. In order to satisfy A ⊆ B, every element e in {1..n} must be one of three cases (out of four equally probable events):
- e is in A, e is in B
- e is in A, e is not in B <- this must be avoided
- e is not in A, e is in B
- e is not in A, e is not in B
@Bubbler I understood the reasoning, but it doesn't seem to work out when I test it by hand.
How do you choose A and B?
They must be randomly chosen out of 2^n possible subsets of {1..n}
The summing over all possible values, feels a little "expected value-y" to me. I'm wondering if I'm missing out on some tricks because I never did expected values. On the one hand, I can imagine it being the case that it would work, but I can also imagine it being the case that it doesn't work.
04:22
I don't do sum
user is incorrect
Aren't you kinda summing over all possible sizes of A and B, and then dividing by |A|*|B|?
Not here, but in principle.
No, size is irrelevant.
@Bubbler Oh wait, right you never use size here.
That does make sense now that you've totally abstracted away A & B.
Wait no, no it doesn't. Because you're still assuming that all four of those scenarios are equally likely.
You are making that assumption, right?
@AviFS It is not an assumption.
When you choose a subset of A uniformly at random, for every number e in {1..n}, the probability of e being in A is 1/2.
Hmm, that's the step I don't follow. That's the part that seems like an average-y thing.
@Bubbler Right, that's been my hangup.
Alright, I can see it.
It's like a change in perspective. From thinking about picking an element of A, to thinking about an e being picked.
Which of course is a boolean, and is just as likely to be picked as not picked.
04:30
Yes.
the intuitive way to see that is that if you list out the powerset of a set, then there are an equal number with e as without, which you can see by just excluding e, and then if you add e back in, you have the existing powerset and then a copy of each set containing e
@Bubbler Thank you.
@Bubbler Does all of this follow from similar logic, though?
Oh right, it does. It becomes 1/2 * 1/2. I gotcha!!
Yes, from independence of events.
Wow. Very elegant.
@hyper-neutrino Ooh, that's really nice.
Have you seen the Numberphile video on powersets as the corners of a hypercube?
I don't think I have but that does seem to be a very logical representation
04:33
@hyper-neutrino This reminds me of that. When you add e back in, to each copy of the existing sets of the powerset, that's the equivalent of extruding the hypercube into another dimension.
ah, yes that makes a lot of sense
I can explain after, but I have a question about the problem before.
@hyper-neutrino I'm shook. I watched a half hour video to understand that whole analogy, haha
@Bubbler Can you check my case for N=2?
well, I'd need to watch the video to fully understand the video, I'm just saying the analogy you drew makes sense to me :P there might be details I'd need more time to get
This is part of what threw me off the (3/4)^n. But it involved listing out all possible sizes of A & B. I'm curious where I went wrong.
0 0:  1
0 1:  1
0 2:  1
1 0:  0
1 1:  .5
1 2:  1
2 0:  0
2 1:  0
2 2:  1
I think you need to take into account the number of cases for each choice of "size of A & B"
04:39
I divided that by 9 and I got 11/18.
so your table should go more like
0 0:  1 x1
0 1:  1 x2
0 2:  1 x1
1 0:  0 x2
1 1:  .5 x4
1 2:  1 x2
2 0:  0 x1
2 1:  0 x2
2 2:  1 x1
and divide the sum by 16.
Oh shoot.
Damn, that'll do it, haha
Thank you.
Let's check what I get now!
Thank you Amazon for curbstomping my power supply box...luckily the side that got crushed was just cables instead of the PSU lol
1+2+1+2+2+1 = 9
Yup! 9/16. Thanks a bunch, Bubbler.
Np :)
04:41
That's pretty cool.
I wanna see someone do this with combinatorial sums, though. I have so many summation manipulations scribbled down, haha
And there's a whole chapter (like 20-30 something pages) in Graham, Knuth, Patashnik's Concrete Mathematics just on summation identities of N choose K, and derivations + examples.
For each possible size b of B (which covers nCb possibilities of B), there are 2^b possible subsets of B. Sum(nCb * 2^b) happens to be an expansion of (2+1)^n, which is 3^n.
@hyper-neutrino No, that's about it.
The fact that powersets could be represented as the corners of a hypercube was a novel insight for me. And that was really most of the video.
But yeah, once you have that, you generate the n+1-hypercube by copying the existing hypercube over, and just adding the new element to each copied set. So:
0 dimensions (point):
ø
1 dimension (line):
ø --- A
2 dimensions (square):
ø ---- A
|      |
|      |
B --- AB
yeah, that makes sense. that representation format seems familiar like I've seen it somewhere before... it is a novel idea though, I don't think I've thought of powersets that way before either
it also gives you a nice property that an edge exists if and only if the sets differ by exactly one missing/extra element or in the context of bitmaps, the xor is a power of two
So, powersets of {}, {A} and {A, B}.
And you can imagine that for the powerset of {A, B, C}, you can take the square and "pull" it up into three dimensions, with the Cs on that dimension. In other words, make another square copying the exact same elements, and just add a C to each corner. Then just connect each corner.
By doing exactly that, he then drew a 4d-hypercube of the elements of the powerset of {A,B,C,D} which was pretty fun.
Brady had to skip some of the drawing :p
@hyper-neutrino Yup, you're way ahead of me!
But yeah, someone in the comments was talking about how this had applications in error-correcting codes, and some other linear-algebra/cryptography stuff, which I can totally imagine because of those nice properties.
@hyper-neutrino Plus, you even know precisely which element they differ by. On the x axis, you're adding/removing A. On the y axis, you're adding/removing B. On the z axis, you're adding/removing C... Each element has its own unique axis.
Equivalently, each element has its own unique dimension, which kinda sounds cooler ; )
Should we bookmark things like this? haha
04:57
hm, yeah that is pretty interesting. i'm sure there are a lot of applications for which it could be quite powerful; for me though it just seems like a cool idea because I am nowhere near knowledgeable enough to put stuff like this into use :P
@hyper-neutrino 'Course, haha. But it's a useful intuition to have for any number of math problems, or coding challenges. Like the one that just came up ; )
 
1 hour later…
06:23
@AviFS How are "Array" and "APL" similar to each other? Because they both begin with "A" and (if "APL" is pronounced "apple") have two syllables?
 
1 hour later…
07:31
Hello!
 
4 hours later…
11:14
0
A: Sandbox for Proposed Challenges

mousetailResolve a string containing \b, \t and \r code-golf Meta: better title There are many characters that do something special when printed in a terminal. Way to many to list. In this case, we'll consider 2 specifically: \r, or \x0d is a cartridge return. This will move the cursor back to the start ...

 
1 hour later…
12:41
0
A: Sandbox for Proposed Challenges

UndoneStudiosFlipping between languages code-golf I find it fun to write a program in a language A, that outputs a program in language B, that outputs back in A, and so on. Your task is similar to this, described below: Challenge: Select two languages A and B (note: swapping will change the nature of your an...

@SandboxPosts whoa, that was fast
12:59
What is the golfiest code to print 4.56458314100509023986577469558 in C?
that's numberwang!
on to round 2, someone to play.
@lyxal what is numberwang??
:)
A great cultural reference!
But I still want to know the answer :)
I should know, but at the same time, I don't
13:08
@Simd think a British panel game show but satire and a sketch from a larger comedy show
@Simd I heard about it from a letter from a Mrs Trellis of North Wales
4.56458314100509023986577469558 gets trimmed in Python, dunno if it gets trimmed in C as well
For a start: main(){puts("4.56458314100509023986577469558");}
@Simd What's the significance of that specific value?
@UndoneStudios ato.pxeger.com/… Take ABC=python 3.9, 3.10, and 3.11
That's R(10), no?
14:08
@mousetail it's the first value from my challenge
@Adám yes
@lyxal total class :)
@UndoneStudios can you try with float128?
@UndoneStudios I think you will need
#include <quadmath.h>
#include <stdio.h>

int main(void) {
__float128 value = 4.56458314100509023986577469558Q;
The printf function has a special format specifier for float128 values, which is %Qf I think
But I haven't got a C compiler here
It would be great if someone could try it out please
Doesn't seem to work with a long double either: ato.pxeger.com/…
I wouldn't expect long double to work
But I think you left out stdio?
It's optional
Golfers usually omit it
Long double is 128 bit though right?
@mousetail I believe not
Sizeof seems to say it's 16 bytes
14:19
On the x86 architecture, most C compilers implement long double as the 80-bit extended precision type supported by x86 hardware
It's 80 bits on a standard Linux box at least
"generally stored as 12 or 16 bytes to maintain data structure alignment"
It's 16 bytes on my generic linux machine too
@mousetail right but sadly not 128 bit for the purpose of precision
Unless you are doing something clever with gcc
Oh that's sad
But maybe you can use your __float128 on ATO still?
@mousetail try this
#include <float.h>

printf("%e %e %Le\n", FLT_EPSILON, DBL_EPSILON, LDBL_EPSILON);
What does it give you?
You can do that on ATO
14:34
I am on my phone which makes everything difficult
Thanks
So 10^(-19) is about 2^(-63)
It's 80 bits
 
4 hours later…
19:00
If you toss n biased coins, what's the probability of getting at least one tail and one head?
1/2?
CMQ ^^
at least or exactly one head?
@Seggan at least
And one tail
You need both to happen
argh i just took probability why cant i solve this
19:04
:)
probably 1 - P(no heads) + P(no tails)
If there are no heads they are all tails of course
The answer for n=3 is 3/4
@Simd how does that change it?
Do you get 3/4 for n=3?
If the coins are fair I mean
Just to test
Yes you do
:)
yep
i think its 1 - 2 / (2^n)
since the chance for all heads/tails is 1 / (2^n)
the chance for either of them is 2 / (2^n)
then subtract that from 1 to get the chances of that not happening
19:38
@Seggan thanks!
is anyone able to code in a fast language? (I can't really)
choose one: rust or kotlin
(i cant program today tho)
@Seggan rust another day?
maybe tomorrow?
@Simd I can write Hello World in C :P
@user awesome!
Hola mundo too?
thanks to chatgpt I can too :)
Oh yeah
I can say Hello World in any language
19:45
:)
This is what they call being a polyglot right?
brainfuck?
@Simd tomorrow might work
Well, there are brainfuck generators out there, so I guess so
@Seggan cool
19:46
what u want me to write?
oops
had my russian keyboard on :P
@Seggan I want to count how many integers less than 2^30 have no factors below 2^14
may i ask why?
yesterday, by Simd
CMC count the number of composite numbers less than 2^30 with no factors less than 2^14
sus
@Simd 0
Other than 1, I assume
Surely there are primes greater than 2^14 and less than 2^30
Possibly even a handful of composite numbers that are products of such primes
20:03
Is 16 the only number which can be written as a**b and b**a where a =/ b and a, b E N?
smh wolfram alpha isn't returning anything
20:21
@Seggan why 0?!
@user quite a lot :)
@Simd all numbers have 1 as a factor :P
@Seggan ah yes.. :) no factors above 1 and less than 2^14
@user yes!
@user suspect?
@Seggan I am hoping it is something like 57676950 but I would love an exact answer
@Seggan please tell me how wrong I am :)
tmrw
thanks!
I look forward to being humiliated ;)
20:38
Hey guis
heard of the game no thanks?
The rules are fairly simple, and I think it'd make a rather good koth
There's no clear strategy either
what do you think?
21:06
@Simd Wait really? I thought for a composite number to meet those criteria, it'd have to be the product of two primes between 2^14 and 2^15
@Simd It often seems like your CMCs are something you actually need in the real world, not just fun little questions you thought of in the moment. Which is fine, but if it's a real problem you're facing and you need a solution in a particular language meeting some particular criteria, you might as well include that in your CMC
@mathcat Looks like it'd make for an interesting KotH. I've never made a KotH though so don't actually listen to me
 
1 hour later…
22:25
How would I go about finding the most popular tags on a SE site? Asking for a friend, who isn't me :p
the default order is by popularity :P
bruh
22:48
yesterday, by Radvylf Programs
It's 6492559
23:18
9
Q: Shortest disk image that boots UEFI

sleirsgoevyPresumably everybody here knows that for the legacy BIOS, the tiniest bootable disk image is 512 bytes (the lower bound is due to the 2-byte magic at offset 510), and there is a bootsector demoscene where people try to fit the entire demo into the 510 bytes of usable space. Now that the BIOS is b...

@cairdcoinheringaahing seems that the chain was longer than I thought: codegolf.stackexchange.com/a/256052
Crossed out 44 is still 44 :(
@Bubbler that's numberwang!
Time to go to the math board
23:41
0
Q: Find the Prime Signature

SamathingamajigThe Prime Signature of a number is the list of the exponents of the prime factors of a number, sorted in descending order (exponents of 0 are ignored). Inspired by Combo Class's "The Magnificent Patterns of Prime Signatures" video. For example, the prime factorization of 6860 is 2 * 2 * 5 * 7 * 7...


« first day (4352 days earlier)      last day (788 days later) »