[ rss / options / help ]
post ]
[ b / iq / g / zoo ] [ e / news / lab ] [ v / nom / pol / eco / emo / 101 / shed ]
[ art / A / beat / boo / com / fat / job / lit / map / mph / poof / £$€¥ / spo / uhu / uni / x / y ] [ * | sfw | o ]
logo
technology

Return ]

Posting mode: Reply
Reply ]
Subject   (reply to 26139)
Message
File  []
close
windmill-beard.jpg
261392613926139
>> No. 26139 Anonymous
17th October 2017
Tuesday 3:49 pm
26139 spacer
def kaprekar(n): assert 0 <= n <= 9999 curr, prev = n, -1 while curr != prev: digits = '%04d' % curr print(digits) desc = int(''.join(sorted(digits, reverse=True))) asc = int(''.join(sorted(digits))) curr, prev = desc - asc, curr # demo for i in range(10000): kaprekar(i) print('----')

Expand all images.
>> No. 26147 Anonymous
18th October 2017
Wednesday 11:26 pm
26147 spacer
>>26139
It's taken me a while to figure out what the code was doing when I should have just googled it.

https://en.wikipedia.org/wiki/Kaprekar_number

Interesting lad.
>> No. 26148 Anonymous
18th October 2017
Wednesday 11:38 pm
26148 spacer
I did google kaprekar when this first appeared but I am none the wiser.
>> No. 26149 Anonymous
19th October 2017
Thursday 3:03 pm
26149 spacer
Whatever language that's in (Python?), the syntax is atrocious -- and I say that having worked with VB for a year.
>> No. 26151 Anonymous
19th October 2017
Thursday 4:21 pm
26151 spacer
>>26148

It is a number where if you take the power of the number and add the front half to the back half together you get the orginal number.

for example

9x9 = 81
8+1 = 9

The rules of where you choose to split the front from the back are wholly arbitrary however which makes it more of a party piece than a serious exercise.
>> No. 26152 Anonymous
19th October 2017
Thursday 4:26 pm
26152 spacer
>>26151
Presumably this only works in base ten counting systems too so it is entirely pointless.
>> No. 26153 Anonymous
19th October 2017
Thursday 4:50 pm
26153 spacer
>>26151
That doesn't appear to be what the code in the OP is doing. I can't see any split operations.
>> No. 26155 Anonymous
19th October 2017
Thursday 6:29 pm
26155 spacer
>>26147
Did you really figure out what the code did? You linked the wrong article. This code illustrates Kaprekar's constant, not Kaprekar numbers.

https://en.wikipedia.org/wiki/6174_(number%29
>> No. 26156 Anonymous
19th October 2017
Thursday 6:30 pm
26156 spacer
>>26154
None of which gets us any closer to why OP posted it in the first place.
>> No. 26157 Anonymous
19th October 2017
Thursday 8:15 pm
26157 spacer
I struggle to see the difference between this end of maths, and pokemon collecting.
Passes the time, keeps nerds out of circulation, but hardly worthy of praise.
>> No. 26158 Anonymous
19th October 2017
Thursday 8:48 pm
26158 spacer
>>26157
The same used to be said of non-Euclidean geometry (what was the point?), large prime numbers (why bother searching for them?), and frequently of "pure" maths (i.e. not directly related to physics, engineering etc) in general. In the past this was often considered almost a plus; the nice thing about maths was that it rarely had any application outside of itself and was almost solely the domain of those who were interested in the topic for intellectual rather than practical reasons.

Non-euclidean geometry formed the bedrock of our current understanding of the universe (relativity), and large prime numbers gave us the building blocks of cryptography.

I'm not saying Kaprekar numbers are useful. They may forever be a mathematical novelty. There's an outside chance, though, that there's a whole field with wide-ranging applications waiting to be discovered that depends on them, as silly as that sounds.
>> No. 26159 Anonymous
19th October 2017
Thursday 9:15 pm
26159 spacer
Non-Euclidean geometry, I can feel the joy. In primary school, after all the rote geometry stuff, to be introduced to 'and now, if we do it all on the surface of a sphere, f'rinstance, the rules change completely and you have to do it all again from first principles' - and there's nothing much more special about a sphere than any other surface, so bring it on, solve it generally. That's fine. That's great, even. But fucking around picking out patterns within base 10 because we happen to have 10 digits? Artificial fuckery. No joy, just stamp collecting.
I've drunk a lot this evening, sorry.
>> No. 26161 Anonymous
19th October 2017
Thursday 11:03 pm
26161 spacer
>>26159
None of that sounds like primary school work unless you were some kind of child prodigy?
>> No. 26162 Anonymous
19th October 2017
Thursday 11:56 pm
26162 spacer
>>26161
Back in my day...
>> No. 26163 Anonymous
20th October 2017
Friday 12:11 am
26163 spacer
>The same used to be said of non-Euclidean geometry (what was the point?)

I'm by no means an expert, but hasn't non-Euclidean geometry always been directly applicable to navigating around a planet that isn't flat.
>> No. 26164 Anonymous
20th October 2017
Friday 12:30 am
26164 spacer
>>26163
Name one non-flat planet we were navigating before 1997.
>> No. 26165 Anonymous
20th October 2017
Friday 12:32 am
26165 spacer
How do people navigate at night? It can't just be looking at the stars. If I were lost somewhere in the Sahara, how would I know where I am and how to get to civilisation?

As it is right now, I would just head south during the day because I wouldn't know where south is at night.
>> No. 26166 Anonymous
20th October 2017
Friday 12:33 am
26166 spacer
>>26164
Earth.
>> No. 26169 Anonymous
20th October 2017
Friday 1:33 am
26169 spacer
>>26165
>How do people navigate at night? It can't just be looking at the stars

Yes it is exactly that. In the northern hemisphere you would use Polaris, in the southern hemisphere the Southern Cross and the Southern Pointers point to the South Pole. Because of their relative position to the rotational axis of the earth they don't move around much in the sky. It is a more accurate method then using the sun to work out where south is which moves a full 180 arc across the sky.

>If I were lost somewhere in the Sahara, how would I know where I am and how to get to civilisation?

What makes you think day light would help if you are already lost? Knowledge of what direction south or north is only meaningful if you know where you are relative to other things. Then you can make judgements based on other factors like time, angle and speed to navigate.
>> No. 26170 Anonymous
20th October 2017
Friday 1:34 am
26170 spacer
>>26164

What is it that you think changed in 1997?
>> No. 26171 Anonymous
20th October 2017
Friday 8:25 am
26171 spacer
>>26170
Sojourner navigated Mars.
>> No. 26172 Anonymous
20th October 2017
Friday 10:13 am
26172 spacer
>>26171
A mere five centuries after the likes of Columbus and Magellan navigated Earth.
>> No. 26173 Anonymous
20th October 2017
Friday 12:11 pm
26173 spacer
>>26172

And only two thousand two hundred years since Eratosthenes calculated the circumference of the earth.
>> No. 26174 Anonymous
20th October 2017
Friday 12:16 pm
26174 spacer
>>26173
I know, right? It's almost as if mathematically Sojourner didn't really change anything.
>> No. 26175 Anonymous
20th October 2017
Friday 1:57 pm
26175 spacer
>>26169
So can you know where you are based on the stars alone?
>> No. 26176 Anonymous
20th October 2017
Friday 2:46 pm
26176 spacer
>>26175
You can determine latitude easily. Longitude is rather more difficult, for obvious reasons.
>> No. 26178 Anonymous
20th October 2017
Friday 4:20 pm
26178 spacer
>>26175
If you knew what day of the year it was and time of night you could definitely do it.

The time of night you could probably make some sort of estimate of based on the position of the moon after knowing the time of year. The time of year you could make a 'good enough' estimate based on which stars are present in the sky for a broad estimate and then use the phase of the moon to calculate a more exact date.

I have really no idea how precise any of this navigation would be based on eyeballing, probably good enough to get you across an ocean and in the direction of the right port.

If you had precision measuring tools and a sophisticated computerized star chart you could probably calculate your exact position on the earth.
>> No. 26179 Anonymous
20th October 2017
Friday 4:34 pm
26179 spacer
>>26178
It was not really known how to calculate longitude accurately until around the 18th century. The major way people determined it was by using latitude, speed and direction to estimate it using the ships vectors of movement against a known position.
>> No. 26180 Anonymous
20th October 2017
Friday 5:08 pm
26180 spacer
>>26179

I agree but the question was about ability to determine your position with no other points of reference.
>> No. 26224 Anonymous
27th November 2017
Monday 3:43 pm
26224 spacer

https://www.youtube.com/watch?v=d8TRcZklX_Q

Return ]
whiteline

Delete Post []
Password