this post was submitted on 17 Jul 2024
255 points (93.2% liked)

Showerthoughts

29698 readers
2743 users here now

A "Showerthought" is a simple term used to describe the thoughts that pop into your head while you're doing everyday things like taking a shower, driving, or just daydreaming. A showerthought should offer a unique perspective on an ordinary part of life.

Rules

  1. All posts must be showerthoughts
  2. The entire showerthought must be in the title
  3. Avoid politics
    1. NEW RULE as of 5 Nov 2024, trying it out
    2. Political posts often end up being circle jerks (not offering unique perspective) or enflaming (too much work for mods).
    3. Try c/politicaldiscussion, volunteer as a mod here, or start your own community.
  4. Posts must be original/unique
  5. Adhere to Lemmy's Code of Conduct-----

founded 1 year ago
MODERATORS
 

Amazon is running a Prime Day sale on July 16 and 17. Setting aside the fact that this is two separate days, neither 716 nor 717 are prime numbers. They should've done 7/19 instead.

top 43 comments
sorted by: hot top controversial new old
[–] odium@programming.dev 40 points 4 months ago (2 children)
[–] hddsx@lemmy.ca 32 points 4 months ago (7 children)

I maintain that dd/mm/yyyy and mm/dd/yyyy are stupid.

Big -> small is how we read numbers:

yyyy/mm/dd

[–] Old_Jimmy_Twodicks@sh.itjust.works 48 points 4 months ago (2 children)

I prefer the simple dy/my/dy/my format (with the year reversed for added ease of use). For example, today would be 14/02/70/72.

NIST and ISO have stopped responding to my emails, but I'm optimistic that the Türk Standardları Enstitüsü will eventually adopt it as their preferred standard.

[–] UncommonBagOfLoot@lemmy.world 10 points 4 months ago* (last edited 4 months ago) (1 children)

I prefer the MYOWN-16080 standard of yy/dm/md/y/y. Also the year units are randomly swapped for encryption

[–] hddsx@lemmy.ca 6 points 4 months ago

What a shitty standard. Where are the check bits? Are you using PGP?

[–] BackOnMyBS@lemmy.autism.place 3 points 4 months ago

lmaoooo and the fucking year digits are backwards 🤣🤣🤣 i knew the date and it still took me a while to figure it out

[–] davidgro@lemmy.world 23 points 4 months ago (1 children)
[–] ThePantser@lemmy.world 2 points 4 months ago

Julian date club 24199

[–] Nurse_Robot@lemmy.world 14 points 4 months ago (3 children)

Yeah, but you have to admit mm/dd/yyyy is way more stupid. Small -> big makes more sense than middle -> small -> big

[–] hddsx@lemmy.ca 6 points 4 months ago (1 children)

For every day purposes, absolutely. For programming? Nope, the only right answer is big->small.

Honestly, the alternative to every day use is to stop using numbers for the month

[–] odium@programming.dev 5 points 4 months ago (1 children)

The problem with three letter month codes is language to language difference. Numbers are more universal.

[–] Zorque@lemmy.world 1 points 4 months ago* (last edited 4 months ago)

12 is smaller than 31 is smaller than ∞, though.

Really, we can all come up with vastly reasonable reasons the date system we prefer makes the most sense... but in reality it's all very subjective. Not only will different methods be appropriate for different situations... but some people just prefer their own way.

It's all really moot, though. We should have been using stardates for the last 55 years anyways.

[–] booly@sh.itjust.works 1 points 4 months ago (1 children)

Actually, I disagree that DD/MM/YYYY even qualifies as being small to big.

If you actually treat it as a counter from 01/01/2024 onward, note that the first digit that moves is actually the second digit in the 8-digit representation. In terms of significance, the most significant digit is the 5th one in the string, then counting down the significance it's 6th, then 7th, then 8th, then jumps back to the 3rd, then the 4th, then the 1st, then the 2nd.

[–] Nurse_Robot@lemmy.world 2 points 4 months ago

A day is less than a month, is less than a year

[–] booly@sh.itjust.works 4 points 4 months ago

Yes, and recurring dates naturally drop the year, so MM/DD better fits that general rule.

[–] esc27@lemmy.world 3 points 4 months ago* (last edited 4 months ago) (1 children)

What if we just count all the nanoseconds since 1601 and divide by 100.

I still don't get that timestamp approach. Especially after learning how unix/linux handle it...

At least modern AD tools can automatically do the date conversions now.

[–] hddsx@lemmy.ca 1 points 4 months ago

Because it’s a basic data structure that holds time, instead of multiple interrelated ints…. And it’s easy to do math on.

[–] fubbernuckin@lemmy.world 1 points 4 months ago (1 children)

Yes but small is more relevant since you're more likely to know the big. therefore i propose we put minutes ahead of hours.

[–] hddsx@lemmy.ca 1 points 4 months ago

Big is more important than small. If your use case has the big stuff in context, drop the big.

[–] some_guy@lemmy.sdf.org 1 points 4 months ago

^^ This is the only acceptable way to write out the date numerically. I'll die on this hill.

[–] Artyom@lemm.ee 11 points 4 months ago (1 children)

You mean YYYY-MM-DD right? Right?!?

[–] odium@programming.dev 2 points 4 months ago

That would not give a prime number

[–] perviouslyiner@lemmy.world 34 points 4 months ago (1 children)
[–] Aatube@kbin.melroy.org 7 points 4 months ago

But 197 satisfies all

[–] synae@lemmy.sdf.org 19 points 4 months ago (1 children)

Please don't ascribe any more meaning to prime day other than a cynical late-stage-capitalist plot for money to flow from the masses to bezos.

[–] booly@sh.itjust.works 2 points 4 months ago (1 children)

No, I'm taking back the word "prime" from a company that shouldn't have exclusive rights to define the term. I'm not going to cede that territory just because I don't like the company.

[–] synae@lemmy.sdf.org 3 points 4 months ago

seems like the opposite, I'd suggest to stop reminding people that amazon prime day is a thing

[–] Euphorazine@lemmy.world 19 points 4 months ago

July 16th is the 197th day of the year on non leap years. July 17th is the 199th day of the year on leap years.

Both of those are prime.

[–] Flax_vert@feddit.uk 18 points 4 months ago (1 children)

What about people using the normal date system

[–] booly@sh.itjust.works 19 points 4 months ago

ISO 8601 is the only normal date system.

[–] EmoDuck@sh.itjust.works 13 points 4 months ago (1 children)

How the hell is 717 not a prime number? Who fucked that up? I vote we just change that

[–] olafurp@lemmy.world 3 points 4 months ago (1 children)

Divisible by 3. Easy to check since 7 + 1 + 7 = 15 which is divisible by 3.

[–] FeatherConstrictor@sh.itjust.works 4 points 4 months ago (4 children)

Oh awesome that's a neat trick I've never seen before. How does that work? For a number like 700 for example, 7 + 0 + 0 = 7 but 700 is visible by 10.

[–] Wasgaytsiedasan@feddit.de 5 points 4 months ago (1 children)

You can only use this method to check if the number can be divided by 3.

[–] booly@sh.itjust.works 2 points 4 months ago (1 children)
[–] booly@sh.itjust.works 2 points 4 months ago

If you're looking for a proof:

Our base 10 system represents numbers by having little multipliers in front of each power of 10. So a number like 1234 is 1 x 10^3 + 2 x 10^2 + 3 x 10^1 + 4 x 10^0 .

Note that 10 is just (3 x 3) + 1. So for any 2 digit number, you're looking at the first digit times (9 + 1), plus the second digit. Or:

(9 times the first digit) + (the first digit) + (the second digit).

Well we know that 9 times the first digit is definitely divisible by both 3 and 9. And we know that adding two divisible-by-n numbers is also divisible by n.

So we can ignore that first term (9 x first digit), and just look to whether first digit plus second digit is divisible. If it is, then you know that the original big number is divisible.

And when you extend this concept out to 3, 4, or more digit numbers, you see that it holds for every power of 10, and thus, every possible length of number. For both 9 and 3.

[–] derpgon@programming.dev 4 points 4 months ago

It works differently for each number. For 2, the last number has to be divisible by 2. For 3, the sum of the digits has to be divisible by 3 For 5, the number has to end with a 0 or a 5. For 7, it is kinda tricky. Take the last digit, double it, and subtract it from the numbers on the left. If the remainder is 0 or divisible by 7, the whole number is divisible by 7. For example 49: 9×2=18, 4-18=-14, -14/7=2 with remainder 0. For 700, 0×2=0, 70-0=70, 70/7=10 remainder 0.

This is usually specified for prime numbers, for non-prime number, you just do calculate the prime components of a number and combine the rules.

For example, divisibility by 15: it has to be divisible by 3 and 5. 1+5=6, 6/3=2 remainder 0. 15 ends with a 5. For number where with multiple same prime components the rules for these duplicate numbers have to apply multiple times. Like for 25, it has to end with a 5 or 0, and when dividing the number by 5, the result has to end with a 5 or a 0 aswell.

[–] Audacious@sh.itjust.works 2 points 4 months ago (1 children)

Back in the olden days before digital calculators, people had tricks like that to help them do mental math.

😂 I'm familiar with many of them because I liked math in school and went through all of primary and middle school without a digital calculator. This one is one I hadn't heard of before and, again because I like math, I'm interested in understanding 1) what the trick is and 2) mathematically how it works out

[–] owsei@programming.dev 2 points 4 months ago

A programmer I know wrote a small paper about this

[–] ch00f@lemmy.world 9 points 4 months ago (1 children)

How often do prime numbers occur in epoch time?

[–] booly@sh.itjust.works 3 points 4 months ago

Well the convention was to store it as a 32 bit signed integer, so that is any number from -2^31 to (2^31 - 1). Prime numbers are formally defined as a subset of whole numbers, so let's ignore the negative numbers and the number zero.

Fun fact: the largest signed 32-bit integer is itself a prime. And the wikipedia page lists it as the 105,097,565th prime.

By the time we hit the 2038 problem, there will have been about 105 million seconds since 1970 where the Unix time was a prime number. And it's a 10-digit number in base 10, where prime frequency is something about 4% of the numbers.

Does that answer your question about prime frequency today? Eh, I'm sure someone else can figure that out. If not, I'll probably have to wait until I'm in front of a computer.