« first day (1901 days earlier)      last day (2945 days later) » 

10:00 PM
user image
4
 
and n^n is worse than n!
 
notice how O(log n) is almost rising as slowly as O(1) (which is not rising at all)
 
@Maltysen Oh thanks. That's really helpful
 
O(MG)
5
 
What does n stand for?
 
10:02 PM
Number of elements
 
@ZachGates whatever variable that you're basing your complexity of
it doesn't even have to be a single variable
 
So an array with 7 elements, n=7?
 
@ZachGates that would be the usual assumption
but not nesscarily
 
When it comes to stuff on graphs, you often see v for vertices and e for edges, or m and n for those. So you can have stuff like O(v * e^2) or O(m n), etc.
 
if your algorithm grows not with the size of the array, but say the diff between biggest and smallest element, that becomes your n
or taking, for example, sqrt, your n is the number you're taking the square root of
binary search is O(log n)
 
10:04 PM
You need the person telling you the complexity to also tell you what variable it is in, otherwise it is meaningless
 
newton is O(log log n) (I think)
 
What would sorting be? O(n log n)?
 
@ZachGates at best O(n log n)
 
Oh interesting
 
but quicksort has worstcase O(n^2)
 
10:05 PM
There's technically a way to do better, but it requires additional constraints.
 
What has the bestcase?
 
Some sorts have better complexity in memory but worse complexity in time - you choose the best compromise
 
@ZachGates See here:
A sorting algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the use of other algorithms (such as search and merge algorithms) which require input data to be in sorted lists; it is also often useful for canonicalizing data and for producing human-readable output. More formally, the output must satisfy two conditions: The output is in nondecreasing order (each element is no smaller than the previous element according to the desired total order); The output is...
 
Oh cool. brb :)
 
(I linked to a specific section.)
 
10:06 PM
Is big theta best- or worstcase? I forgot
 
@CᴏɴᴏʀO'Bʀɪᴇɴ theta means asymptotically tight
 
you have to specify best/worst/average
 
I know there's O, big theta, and big omega.
Which is which?
 
Big O is upper bound, big omega is lower bound (I think), and big theta is when big O and big omega are the same. All of these are asymptomatic.
 
10:08 PM
Oh, cool.
 
In practice, it's basically only the big O that matters because it's basically always a good thing to have something finish sooner than expected.
 
but I can totally say that sorting is O(n!)
people will just look at you strange
 
yeah
Technically correct, but not usefully correct. :P
 
Why not just define big O to be a minimal upper bound? Because they don't always know?
 
@CᴏɴᴏʀO'Bʀɪᴇɴ that's what theta is for
 
10:10 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ Yeah, that's an impossible question to answer in many situations.
 
Then why is O useful?
@El'endiaStarman O.
 
It's rare to have a proof that an upper bound is the minimal upper bound.
 
f(x) = theta(g(x)) is defined as k1*g(x) < f(x) < k2*g(x)
 
But for things like sorting, it's kind of easy, right?
> **Worstsort**
designed as the final answer to how inefficient a sorting algorithm can be. It is based on a multilevel sorting algorithm that works as follows. At level 0, multilevelsort is just any classical sorting algorithm such a bubble sort: multilevelsort(L,0) = bublesort(L). Next, for any k > 0, multilevelsort(L,k) generates P = list of all permutations of L, runs multilevelsort(P,k-1), and copies the first element of the sorted P into L. Finally, worstsort accepts two arguments, the list L to be sorted, and a computable increasing function f:\mathbb{N} \to \mathbb{N} (e.g. f(n) = A
 
@QPaysTaxes haha that caption under the animation:
> A possible, but improbable, single shuffle execution of the bogo sort algorithm.
 
10:14 PM
hahahaha indeed
 
@Maltysen "Wow, only two steps! I'll use this for everything!"
dang enter key
 
well back to conic sections. Pyth should have matrix operations
 
@QPaysTaxes yup
 
@El'endiaStarman I guess you mean asymptotic? (They may also by asymptomatic, who knows...)
 
@trichoplax Yes, that.
 
10:17 PM
@QPaysTaxes JobInterviewQuickSort can cause sweating and shortness of breath
 
wow numpy doesn't have any builtins for calculating minors
lel
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Yes?
 
eel
 
@El'endiaStarman lee?
 
10:19 PM
@Maltysen What are minors?
 
In linear algebra, a minor of a matrix A is the determinant of some smaller square matrix, cut down from A by removing one or more of its rows or columns. Minors obtained by removing just one row and one column from square matrices (first minors) are required for calculating matrix cofactors, which in turn are useful for computing both the determinant and inverse of square matrices. == Definition and illustration == === First minors === If A is a square matrix, then the minor of the entry in the i-th row and j-th column (also called the (i,j) minor, or a first minor) is the determinant ...
 
'ell
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Oh hey, I know someone with that name!
A few, actually.
 
@El'endiaStarman Me as well :P
 
I have that name
 
10:21 PM
...
 
it's my Korean last name and my English middle name
 
@Maltysen So, is the minor the smaller matrix, or is it the determinant of said smaller matrix?
 
i see
how many names do you have total
 
uhh depends on how you define "name"?
 
@El'endiaStarman the minor is the smaller one, but the det of it is often useful, and is how you calculate the determinant of the original matrix
 
10:23 PM
you have 3 english names, 1 nickname, and some number of korean names
but 1 english name is the same as one of the korean names so subtract one i guess
not counting doorknob or keyboardfire
 
Korean has kind of first names and last names I guess
 
Chat challenge: solve PE 21 in the least amount of bytes.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ PE 21?
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Express? As in, say the problem in the fewest bytes?
PE21 - 4 bytes
 
ಠ_ಠ
@El'endiaStarman Better: PEl, base 36.
 
10:29 PM
Does anyone have any ideas on a smaller upper bound for this:
Are you saying "regard any matrix that hasn't stabilised by 250 generations as never stabilising", or do answers need to choose a number of generations that is provably sufficient to draw that conclusion? For example, 2^(15*15) is provably enough generations, as a given matrix always has the same successor and there are only this many possible matrices. I suspect there are much smaller upper bounds but I don't know how to prove one. — trichoplax 1 min ago
 
Google is flying me out for an interview!
 
@NathanMerrill \o/ where?
 
colorado
it's my preferred location
 
0
A: ¿xu ti te gismytermorna? (Is it a valid gismu?)

Mama Fun RollJavascript ES6, 240 bytes x=>eval(`/${(c='[bcdfgjklmnprstvxz]')+c+(v='[aeiou]')+c+v}/${t='.test(x)'}?/^[bfgkmpvx][lr]|[cs][fklmnprt]|d[jrz]|[jz][bdgmv]/${t}:/${c+v+c+c+v}/${t}?!/^..((.)\\2|${V='[bdgvjz]'}${U='[ptkfcsx]'}|${U+V}|[cjsz][cjsz]|cx|kx|xc|xk|mz)/${t}:!1`) I guess this is my work now.

I guess I can do this, considering that this is my doing.
 
I think I might have found a mistake in PE 50! :D
991 is a prime that can be written as the sum of the primes [127,131,137,139,149,151,157] that's less than 1000
 
10:43 PM
consecutive primes
are those all consecutive?
 
Yeah, I think so.
They should be, I generated a script.
:D
Where do I report a problem?
o_o
 
yeah, I believe you are right
 
It says the longest sum, not the highest.
 
...
oh
Thanks :P
Now i have to rework my code >_<
 
10:49 PM
Always glad to help :P
 
You saved me the trouble of making a pe.chat account, anyhow
 
at least this variety is easier
 
pyth thing is down
 
D:
Chat mini-challenge: return all primes below N, input
@QPaysTaxes m{
10 bucks I can outgolf you in jolf.
XD
 
if there was a bot on Yahoo answers that automatically answered every new question, I wonder how long it would take before anybody noticed
 
11:00 PM
@NathanMerrill "10 years and 15.2k answers and they still haven't caught on."
Indeed :)
You can replace _f with ψ
 
VQIP_NN in pyth
 
@QPaysTaxes That's great! I'd be interested to hear what you do have to change in your existing code. I'm not super familiar with all of the differences between Ruby and Crystal.
 
Also, it's more "correct" in jolf to use J or j for numeric input.
@QPaysTaxes There is no difference, except semantically. j takes only numeric, whilst x takes eval'd input.
Also, they are remnants of the initial jolf.
 
What would be a good blanket term for challenges that iterate through a set of instructions and then run them via the spec? E.g. this one and this one
 
@QPaysTaxes They are two different inputs.
@QPaysTaxes Yes, but they represent two different variables.
+*jJj

var j = Number(prompt("j = "));
var J = Number(prompt("J = "));
add(mul(j, J), j);
I know, just wanted to do that. It helps (or is required by) some people visually. IDK how many of those people are programmers
Which lang?
(BTW, jolf, 5 bytes: ~Bj©{)
 
11:11 PM
more chat challenges please
 
@QPaysTaxes :3 there are quite a lot.
@poi830 Okay!
Given two numbers a and b, output if they are amicable
(no builtins)
@QPaysTaxes as a number?
cool!
 
@QPaysTaxes Ah, that's too bad. Are you otherwise enjoying Crystal? Have you noticed any speed improvements?
Are you going to continue with Crystal or stick with Ruby, do you think?
 
@QPaysTaxes Will there be any other chars in the input?
k
Jolf, 23 bytes: Ζ0Μid?=H'+Ζhζ?=H'-Ζwζaζ
Ooo wait
I think I can get it way lower
can you remove the space after the +=1:?
@CᴏɴᴏʀO'Bʀɪᴇɴ No, you can't.
Oh, interesting.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ can it print nothing for false
 
@poi830 Yes.
@QPaysTaxes I had that idea too, but my problem was with carrying the value across .
True...
 
11:25 PM
can you declare functions in pyth
 
@poi830 L or M
 
thanks
 
@QPaysTaxes I don't see much use in doing so, besides this challenge. A "counter" wouldn't do much good.
 
@QPaysTaxes Pyth is ascii only, so everything is printable :P
 
^
 
11:27 PM
i don't get your point. the Pyth code is printable
 
@Maltysen wait how do you use the functions
 
@poi830 L defines y(b) and M defines g(G,H)
 
L*2b y2
for something like this
what is wrong
 
@poi830 the space before y
 
i see
thanks
 
11:32 PM
o_O
Is that a documented thing?
You might want to consult the docs; you may just have to approach it slightly differently.
 
hmm
im working on the function thing to shorten the code
but i got the amicable numbers thing in 47
 
You should ask on Stack Overflow
 
I'm 22 minutes away from getting my "fanatic" badge.
=D
 
quick, send a virus to his computer to shut it down for a day :P
 
I do have a phone. :P
 
11:40 PM
We'll send hired badge-control people to your house.
 
You better hurry. Are they ready to get to me within 20 minutes?
 
They are those closest to you
 
@DrGreenEggsandHamDJ they're already outside your door. can't you see them?
 
Dennis uses suspension. It is very effective.
 
No, because I'm on the computer. When I'm on the computer the outside world doesn't exist at all.
2
DR. Ham Jam used ignore. It is very effective.
 
11:42 PM
It has its own tag
 
@AlexA. So does ><>.
 
Really?
 
how do you remove the first element of a set in pyth
 
@poi830 a set doesn't have a first element
 
lol im dumb
i meant a list
 
@poi830 .D
 
thanks
 
@CᴏɴᴏʀO'Bʀɪᴇɴ An entire question. Amazing.
 
and by a PPCGer, no less
 
11:53 PM
well
i got the amicable numbers thing in 56
but i cant use a function to shorten it with pyth
because i use the powerset function which is what it replaces
 
lemme try, what's the question?
 
Iq-hs{mu*GHd1.DyP@QZZ@QZ@Q1Iq-hs{mu*GHd1.DyP@Q1Z@Q1@QZ"T
im not very good so im sure you can do better
 
42 mins ago, by Cᴏɴᴏʀ O'Bʀɪᴇɴ
Given two numbers a and b, output if they are amicable
 
it takes input as a list of 2 numbers
 
11:56 PM
16 bytes: qQ_msP{*M|R]1yPd
 
lol
 
I could've gotten 15 except for the default arg thing for q
 
Jolf, 15 bytes :D &=ΏuZhmδHjJ=ΏJj
Jelly is probably 4 tho
 
Pyth doesn't have a divisor builtin
@CᴏɴᴏʀO'Bʀɪᴇɴ 14: qQ_mhsP{*MtyPd
:P
 

« first day (1901 days earlier)      last day (2945 days later) »