[Jprogramming] quantile support added to stats/base addon

2022-01-09 Thread Ric Sherlock
A new version of the stats/base addon has been released. It includes the following new verbs: quantiles vquantiles of y at the specified probabilities x nquantiles v values which partition y into x quantiles iqr v inter-quartile range (IQR) of y ntiles v assign values of y to

[Jprogramming] Advent of Code Day 20

2022-01-09 Thread Raul Miller
https://adventofcode.com/2021/day/20 For day 20, our puzzle was to use "image enhancement" on a "map" obtained by our sensor/beacon arrangement. Our email system is going to wrap lines here, so keep in mind that there's only a single line before the blank line in this data sample: sample=:{{)n .

Re: [Jprogramming] Advent of Code Day 19

2022-01-09 Thread Raul Miller
I should perhaps clarify -- since there's no actual physical coordinates involved here. I am using "left handed" and "right handed" to refer to what should maybe be labeled as the parity of the axes of the coordinate system. I really need better vocabulary for talking about these distinctions. Th

Re: [Jprogramming] Advent of Code Day 19

2022-01-09 Thread Raul Miller
Also, ... I believe that that cross product is a right handed cross product. It would be interesting to think about what would need to change to make a left handed cross product work (for example, the cross product implementation in the complete tensor essay in the wiki). (I had thought that I was

Re: [Jprogramming] Advent of Code Day 19

2022-01-09 Thread Pierpaolo Bernardi
Il giorno 9 gennaio 2022, alle ore 20:56, 'Michael Day' via Programming ha scritto: >Chat really,  but I think it still belongs here. >I've just had another look at the performance stats for day 19. The numbers >solving parts 1 & 2 are 15420 and 236, respectively., at the time of >typing. >Weir

Re: [Jprogramming] Advent of Code Day 19

2022-01-09 Thread Raul Miller
Oops, I thought I had included that in my message. My apologies: NB. from https://code.jsoftware.com/wiki/Phrases/Matrices cross=:(1 _1 1 * 1 (-/ . *)\. ])@,. Good question, thanks. -- Raul On Sun, Jan 9, 2022 at 9:49 AM 'Michael Day' via Programming wrote: > > Raul, would you mind defining

Re: [Jprogramming] Equal result unexpected

2022-01-09 Thread Raul Miller
I see several issues here. First off, I should point out that you have some useless code in your leftR and in your rightR implementations. These do not affect the outcome, but do influence readability. Here's my rephrasing with that useless code removed: leftR=: {{ x * (0{y) + 1{y }} rightR=:

Re: [Jprogramming] Advent of Code Day 19

2022-01-09 Thread 'Michael Day' via Programming
Chat really,  but I think it still belongs here. I've just had another look at the performance stats for day 19. The numbers solving parts 1 & 2 are 15420 and 236, respectively., at the time of typing. Weird - once you've done part 1,  there's hardly anything further to do in part 2 ! Perhaps

Re: [Jprogramming] Equal unexpected - hope with better formatting

2022-01-09 Thread Henry Rich
Floating-point addition is not associative or distributive.  It looks like you have some roundoff error that is greater than the comparison tolerance but less than the print precision. Henry Rich On 1/9/2022 12:23 PM, Pawel Jakubas wrote: Dear J users, I am testing very simple multiplication

[Jprogramming] Equal unexpected - hope with better formatting

2022-01-09 Thread Pawel Jakubas
Dear J users, I am testing very simple multiplication property: s (A+B) = sA + sB using emulated property testing (more on this here https://github.com/paweljakubas/j-random-matrices/blob/main/chapters/algebra.md#testing-matrix-properties ) So basically I am doing something like this: NB. picking

[Jprogramming] Equal result unexpected

2022-01-09 Thread Pawel Jakubas
Dear J users, I am testing very simple multiplication property: s (A+B) = sA + sB using emulated property testing (more on this here https://github.com/paweljakubas/j-random-matrices/blob/main/chapters/algebra.md#testing-matrix-properties ) So basically I am doing something like this: *runiform=:

Re: [Jprogramming] Advent of Code Day 16

2022-01-09 Thread Brian Schott
I have begun to punt on the aoc about here. Even with this part a solution I got frustrated thinking about the parsing of "operator" packets even on part a. Your explanation and code is very informative. For example in this day 16 question the snippet below was very satisfying because I could not s

Re: [Jprogramming] Advent of Code Day 19

2022-01-09 Thread 'Michael Day' via Programming
Raul,  would you mind defining cross?  I've tried */ and (+/  .  *) but neither seem to work for me,  and I'm not sure what you mean. As I said a few days ago,  I gave up wondering why I'd found 48 rotations when they asked for 24,  couldn't grasp what the meant by facing" and resorted to matr

Re: [Jprogramming] Advent of Code Day 19

2022-01-09 Thread Raul Miller
Here's a better 'relori', in my opinion: NB. y: scans from two scanners relori=: {{ sigs=: signature each y upsigs=: 0-.~(~. #~ 2 = #/.~) ;~.@,each sigs masks=: (* wrote: > > https://adventofcode.com/2021/day/19 > > Like a variety of my work on previous days, my code here is rather > bulky.