« first day (1905 days earlier)      last day (2932 days later) » 

7:00 AM
000 024 000
000 023 001
...
000 014 010
001 014 000
...
002 004 000
002 003 001
002 002 002
002 001 003
002 000 004
@DerpfacePython This is the algorithm I can think of, takes 3 bytes
 
@Sp3000 Dang, missed that :D
 
@KennyLau Would something like [-[<]>-[<]>-[<]>-[<]>-[<]>-[<]>-[<]>-[<]>-[<]>-[<]>] and extending on it work?
I could use that as a tester
 
@Sp3000 gogo write a program
 
For if the thing is larger than 10
IDK
throwing around ideas
 
@DerpfacePython Just try my algorithm lol
 
7:01 AM
Sre
Sure
Have to go to sleep 1st though
 
@DerpfacePython ok, see you tomorrow
 
Just like a rest
Thanks @KennyLau
 
@DerpfacePython alright
 
@KennyLau if you order - and / right, then you could put all numbers always at the start, right (for the moment ignoring :)?
 
> for the moment ignoring :
 
7:04 AM
@orlp I think so...
 
The hardest part :P
 
if you do it that way then the bigger number will always be at the top at the stack, so you want - and / to do top - second or top / second
 
@orlp No need to ignore :. It can also be put at the last.
 
@KennyLau well, the stack needs to end up at one number
 
@orlp It doesn't really matter, since you can still swap them
 
7:05 AM
that is what I wanted to steer to
 
1921600 is giving me 29+:*1-19+*1+6:*4+:** which is nowhere near 11
 
can we see :*, :+ as separate operations?
 
@orlp still, all the : can be put at the back
For example,
29+:*1-19+*1+6:*4+:**
 
there is no : in the back
in that example
 
I see
I can't convert that to all-back
I guess you can't put everything at the back
@Sherlock9 The first part 29+:*1- is 120?
 
7:07 AM
It's done from left-to-right in that order, so I'm not sure how moving the operations around wouldn't affect the order
Yes
Then times 10 plus 1 to get 1201
 
654** is even shorter
So I'm not sure what your program is doing
 
Then make 1600
 
I don't think it was a program :P
 
Your program is treating :* and :+ as two operations...
 
Messing around mostly
No, they're two separate operations
 
7:08 AM
Your program is also treating them as one byte
 
I said nowhere near 11
 
1201 is really 12658***+
57*:*38- (35**2 - 24)
by inspection lol
 
@KennyLau That gets me 481. Did you mean 15568***+?
 
my question, is there ever an optimal solution that requires any series of : to not be followed by an equal length series of *+
 
@Sherlock9 Never mind, the second one is shorter
@orlp Just look at mine
 
7:12 AM
@KennyLau I have no reason to believe your solution is optimal
 
@KennyLau That needs to be 57*:*38*- which is the same length as 15568***+
 
what happens if an operation is used when only one number is on the stack?
 
@KennyLau and in your solution every : is followed by an equal amount of operators
@CameronAavik invalid
 
@orlp What do you mean, like can I have ::*:**?
 
alright, because in the comments someone was saying 9*9*9*...
 
7:13 AM
Stack-based languages are gross; maybe we could have more clarity of thought by looking at it functionally.
 
@CameronAavik That is a regular mathematical example, and not an example of code, I think
 
Like : is let x = f() in op(g(x), h(x))
Where g and h get to use x exactly once.
 
@feersum I should figure out functional languages, verbs, left and right parameters and such very soon
 
@orlp I don't quite get your question. Every : creates one more element, which must get eliminated by an equal amount of * or +.
 
7:14 AM
@KennyLau not necessarily immediately
 
@Sherlock9 All of that crap is only for J
 
Or - Since you can use 6:*6::--- though that isn't optimal for 18 and 36* should be used instead
@feersum Well, I do want to learn Jelly, as well :D
But I am going to go back to Learn You a Haskell and How to Design Programs (this is for Racket) soon
 
@Sp3000 hrm, that's basically ^5
 
Write-only languages, whatever.
 
Oh
@orlp You're asking an instance where : does not appear as :* or :+.
That's basically proven.
wait
not really
 
7:17 AM
15568***+58*:** is 1921600
 
@orlp Yeah, it's meant to be. I wasn't sure whether you meant the *+ follow the : immediately, since in ::*:** the last colon happens after only one * instead of two. But based on your other comment I guess not
 
Which is 15. Not sure what next to try to get <11
 
For example, 78*:5-* = 2856
 
Which lang?
 
@Sp3000 basically I'm trying to get rid of :
 
7:18 AM
How are you proposing to do that? I'm not quite following...
 
and replacing it by instructions that do not grow the stack
 
Oh did you see my post about UGL, zyabin?
 
e.g. + shrinks the stack by 1
:* leaves the stack size unchanged
 
@Sherlock9 Which post?
 
7:20 AM
:<expr>* leaves the stack unchanged
 
@orlp Well the 86387 test case I had was because I was hoping 77*:6-:2-** to be optimal, as in 49*43*41
which you can trivially extend to a longer chain of similar divisors
 
@orlp Prove that every solution must have odd length.
 
2 hours ago, by Sherlock9
@zyabin101 So my friend who is also a programming guy and also an engineering guy took one look at UGL and decided to try implementing it in Arduino
 
@KennyLau that's not very difficult :)
every operation grows or shrinks the stack by 1
we must end at a stack size of 1
the stack is initially length 0
 
That's something I never considered.
I need to optimize my Depth-first search very hard.
 
7:23 AM
@Sp3000 basically, if we can transform the problem in some way that we only ever have to consider operations that shrink the stack or leave the stack unchanged, we do not need to keep track of stacks at all, since we can use the unit size stack
and then every operation is based on one or two numbers
 
@orlp Let's develop a regex that can match every valid expression of length 2n+1
 
@KennyLau fairly certain regex has no such recognition power
(division by zero)
_UNK
 
(?!.+0/)
 
@KennyLau You'd probably want to generate valid programs from ground up than filtering all possible strings via regex
 
58*::56**1+** for 1921600 at 13 operations
 
7:25 AM
@orlp I just realize that if the length of an expression is 2n+1, there must be n+1 instances of [0-9:] and n instances [+-*/].
 
Just realized that as well. So an expression with different total amounts of growing and shrinking operations would definitely be invalid
 
@Sherlock9 Can be used to optimize my DFS very far
 
I don't think you should loop over all strings
I think you should try to combine strings
 
why not?
I tried
It failed me on 3727
 
^^^^^ Lots of memory wasted
 
7:28 AM
@orlp What does your program give for 5256?
 
It takes three layers to generate this: 19:*+59*99**+
Where this takes four layers but is shorter: 78*5+:*6+
 
sigma(15**(2n+1)) for n in range(0, k) where 2*k+1 is the optimal number of operations (when found) is a lot to search through
 
@Sp3000 haven't made it print anything about 1000 yet, sec, let me run it
 
Three layers: ((1(9:*)+)((59*)(99*)*)+)
Four layers: ((((78*)5+):*)6+)
 
Does anyone have any thoughts on my functional representation earlier?
I think if this is correct, it should be clear that negative numbers are not needed.
 
7:31 AM
@feersum fairly certain they are not needed
 
@feersum What are you referring to?
@Sherlock9 Not really.
 
@orlp Oops, sorry overlooked an easy solution. Can you try 6162 instead?
 
I have an idea
 
let x = f() in op(g(x), h(x)) where g(x) and h(x) use x exactly once.
 
@Sherlock9 You only have n+1 instances of [0-9:] and n instances of [+-*/]
 
7:31 AM
As equivalent to using :.
 
@Sp3000 6348*:*+*
 
Ah, I misread it earlier. Well, that could work. Not sure how useful it would be since we're not repeating code very much
 
Hm...
 
@feersum I had a different alternative to :
or maybe it's the same in other words
 
@Sherlock9 Which makes the count (binom(2n+1,n+1)*(11**(n+1)))*(binom(2n+1,n)*(4**n))
 
7:33 AM
you define all functions that do not grow or shrink the stack
e.g. :*, :+ and N+ N- N* N/ for arbitrary N
 
Functions of how many arguments?
 
just confirming, all valid solutions will have an odd length right?
 
@feersum one
 
@CameronAavik Yes, we proved that earlier.
 
well, all shortest ones
alright, cool
 
7:34 AM
@CameronAavik No, all valid ones.
 
then you can ignore :
 
What does the :* function mean?
 
@CameronAavik If you count 12 as invalid
@feersum x**2
anyone notice how J uses *: for squaring.
 
@KennyLau That can't be right.
 
by only considering :..........* and :.......+ where ..... are non-growing/shrinking functions
 
7:35 AM
Because the nyou couldn't use : to calculate x^3.
 
@feersum it duplicates the stack
then multiplies the top by the second-top
 
@feersum 5::** is 5**3
 
@feersum x**3 is x::**
 
I was thinking a good approach would be to cache all the shortest solutions that can be done in 5 or under characters, then work back from the input number
 
@orlp How about 38950002? Should be <= length 11 (not sure if that's too large for your program though)
 
7:36 AM
@Sp3000 too long for now
 
@CameronAavik nice.
But then you can't prove it must be the shortest.
 
Obviously : can be used for cubing in the actual Befunge code.
Why does everyone think I'm so stupid?
 
@orlp Hmm darn, I was hoping to do something like (something that pushes -n) ::*:*+ to calculate n^4-n
 
@feersum :* isn't a special operation in my challenge
 
How did you mean to phrase it, feersum?
 
7:37 AM
I'm discussing @orlp's reference to a ":*" function that is supposed to have equivalent power.
 
@feersum basically I'm trying to get rid of : as an operator, and replace it by a set of non-growing operations
 
Which I still don't follow.
Maybe you could give an example of how to calculate x^3
 
@orlp Feersum is right
 
With :* functions.
 
If you replace that with just squaring
How do you do cubing?
Sorry for the misunderstanding, feersum
 
7:39 AM
@feersum ::**
I never said I tried to replace it with :*
 
I'm just going to go bang my forehead against walls now.
 
I said I want to replace it with :......*, where ..... is any combination of expressions that does not change the stack size
 
No, no. Once you've replaced :* with something else, say @ or something, how do you do cubing
Oh
OH
 
::** is :......* where ...... = :*
 
I see.
 
7:41 AM
So... how does that handle the 49*43*41 and similar example?
 
So yeah, :* is like let x = f() in *(g(x), h(x))
Likewise with :+.
wait no it isn't
Because you can do functions to both uses of x in my example.
 
77*:6-:2-** where :.....* the ..... is 6-:2-* and 2-
 
So I don't see how you would do (x^2 + 7) (3x+5)
With :....*
 
@feersum How would you do that?
 
@KennyLau Do what?
 
7:44 AM
(x**2+7)*(3*x+5)
 
@Sherlock9 Oh... so "does not change the stack size" is nested? Hmm struggling to see the advantage, but okay...
 
Oh right that's impossible.
I'm just bad in stack languages.
 
@Mego Another advantage of non-stack :p
 
@Sp3000 Ask orlp. His idea
 
It's just that there's no swap here, but (x^2 + 7) (3x+5) is definitely possible
 
7:46 AM
x::*7+\3*5+* in stacks
 
Well unless you mean it has to be done with exactly that factorisation?
 
@KennyLau what is \ ?
@Sp3000 well the task is simple
 
@orlp I mean in stacks, not in my challenge
 
you start with a stack [x]
 
In stacks, meaning it's swap. Not valid in this challenge
 
7:47 AM
@orlp In stack-based languages, `\` means swap
 
Double `\\`
 
@Sp3000 Right, I mean it can't be done my multiplying thoes two things at the end.
 
and using "0123456789+-*/:", get [(x^2 + 7)(3x+5)] on the stack
which should be possible, just not in that form
 
So orlp's approach seems to be the right way.
 
@feersum So "exactly that factorisation", then yeah I agree
 
7:48 AM
@feersum that's why I think my approach works
exactly because there is no swap
 
(x**2+7)*(3*x+5) = (3*x**3+5*x**2+21*x+35)
 
the only problem
is that <some number>+ is an operation that doesn't grow or shrink
but as the amount of <some number>s you know goes up, combinations explode
e.g. if you know how to make 2348
then :<expr for 2348>+* should be valid
and so should :<expr for 2348>+<expr for 42>/*
on the positive side, we can throw away the concept of stack size
 
Right, you get complexity of a number instead.
 
N+, N- N*, N/, :...+, :...-, :...*, :.../ are all operations that leave the stack size unchanged
 
@orlp x^2 = x:*
 
7:54 AM
where N is an arbitrary number we found, and ... is an arbitrary expression that doesn't grow the stack
 
3x is obviously x3*
 
@orlp Is there any difference between N and ...?
 
@zyabin101 The problem isn't what's in the brackets, it's multiplying the two expressions at the end
 
Probably length 10 should be doable.
Integer overflows would be super annoying though.
 
@KennyLau yes, N grows the stack by one
 
7:55 AM
Uhh, then idk
 
e.g. 5
 
@orlp Is there any difference between N and :...?
 
@KennyLau I'm trying to get to a system where we can ignore that the stack exists at all
 
I see
 
By definition, every set of operations after the first number, with [1-9:].....[+-*/] will not change the stack size. We have to go from stack size 0 to stack size 1 but we can't do it in one operation for any number larger than 9
I use [1-9:] as 0 is useless for these calculations
 
7:58 AM
I'm actually still not sure whether 0's actually useless
 
it is
 
It follows from negative numbers being useless.
 
@feersum not even then
 
Well, I'm convinced they are.
 
0+, does nothing. 0-, does nothing, 0*, makes TOP 0, 0/, breaks the math
 

« first day (1905 days earlier)      last day (2932 days later) »