Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A Problem To Solve :-)

220 views
Skip to first unread message

Physfitfreak

unread,
Jan 20, 2024, 3:25:29 AMJan 20
to
Farley proposed a few programming problems and I though I'd propose one
as well. So here we go.

-------------Physfit And The Mountain-----------------

In a sweet dream, Physfit, as he is typing away with his machine gun
fingers calling somebody in COLA "cro-magnon", and giving him the sage
advice of fingering himself, he notices through the window blinds, over
there, two blocks away from him, there is a strange mountain in an empty
field that he had never paid any attention to. In fact he had never seen
it before.

Calling it a mountain was just ridiculous of course, cause it was only
100 yards high. Physfit tells himself, "Today is my eating day, so after
eating, to relax a bit I'll climb it and sit there on top of it for a
few minutes."

So after he was done with eating the hearty soup he begins walking
towards the mountain, but as he gets closer, he realizes that its shape
is not that friendly for a quick climb, and in fact more likely he'll
need to have ropes and crampons and harnesses, and you name it to climb it.

So he walks back home and gets in the attic, brings down the dusty box
that had his old mountaineer's equipment (which he never had a use for
in Texas). Opens it up and takes what he thinks he'd need, and together
with some other supplies walks back to the mountain to get on top and
relax before coming back home.

The climb proves not easy. And this makes him even more eager to get it
done and conquer the damn strange thing.

At last, he had gone up no more than 11 yards when he notices the Sun is
already setting!... After all that effort, he thinks to himself,
"Getting back down will take too long and at best I'll make it home
several hours after my sleeping time, plus I'd have to start over
tomorrow from the ground level, making it to this height around the same
time as it is now, with no progress made after 24 hours."

So going back down would beat the purpose. He decides to camp at the
spot he is, for the night, and continue the climb next day. He gets his
sleeping bag in order and crawls inside and falls into a deep wonderful
sleep.

But during the night, as Physfit is snoring in his sleeping bag, this
strange mountain grows itself a hundred yards taller!... So Physfit's
distance to the top gets larger than before he even had begun climbing.
But fortunately, this growth didn't just add another 100 yards to the
height of the mountain, but was done proportionally, which means during
that night, Physfit's height from the ground has also increased
proportionally. So the shape of the mountain remained intact, only its
size got increased and thus added 100 more yards to the overall height.

Physfit wakes up in the morning and finds himself at the height of 22
yards on a mountain that was 200 yards high!... So in this new day, with
much effort and perseverance, he manages to climb another 11 yards up
before the Sun begins setting. And by the same logic he decides to sleep
at the spot he was and continue the climb the next day.

While asleep, the strange mountain grows itself proportionally to make
its height another 100 yards larger...

In the morning, Physfit wakes up and finds himself at the height of 49.5
yards on a mountain 300 yards tall.

While brewing his Walmart National Cup tea-bag (which amazingly after
all the recent inflation was still $1 for 100 tea-bags), he admits to
himself that conquering this summit will be harder than he expected.

Every day, from then on, he climbed another 11 yards, and every night
the mountain grew another 100 yards taller, taking him a bit higher with
it.

Did Physfit reach the summit? If he reached, why he could reach it, and
how many days total it took him to get there? And if he could not reach
it, prove why he couldn't reach the summit.





Farley Flud

unread,
Jan 20, 2024, 9:14:57 AMJan 20
to
On Sat, 20 Jan 2024 02:25:22 -0600, Physfitfreak wrote:

>
> Every day, from then on, he climbed another 11 yards, and every night
> the mountain grew another 100 yards taller, taking him a bit higher with
> it.
>
> Did Physfit reach the summit? If he reached, why he could reach it, and
> how many days total it took him to get there? And if he could not reach
> it, prove why he couldn't reach the summit.
>

Nice problem. But it falls easily to a mathematician.

He reached the summit on day 4983.

Let the day numbers be n. The following table shows the height of
climb and the height of mountain at the end of the day:

(Need mono-space font)

Day n height-of-climb height-of-mountain

1 11 100
2 33 200
3 60.5 300
4 91.67 400
...

At the end of the n-th day the height-of-mountain = 100*n
and the height-of-climb is:

n-1
====
\ n
( ( > --- ) + 1 ) * 11
/ i
====
i = 1


i.e. (summation (n/i, i, 1, n-1) + 1) * 11

This is just the harmonic series multiplied by n. It will
converge quickly.

At end of day 4983 we get:

Day n height-of-climb height-of-mountain

4983 498310.65 498300


But wait! That mutherfucker doesn't reach the top because
he would starve to death after 3-4 weeks.









%

unread,
Jan 20, 2024, 1:02:43 PMJan 20
to
nothing did anything it was all a dream you said so at the start

Physfitfreak

unread,
Jan 20, 2024, 5:47:44 PMJan 20
to
On 1/20/2024 8:14 AM, Farley Flud wrote:
> But wait! That mutherfucker doesn't reach the top because
> he would starve to death after 3-4 weeks.


No, cause one day, very hungry, he looked at the sky and loudly said,
"Fuck that Pope The Penis X!" and suddenly the single sardine can that
he'd taken with him and had eaten as dinner in the first evening on the
mountain, reappeared intact in his backpack pocket. He further examined
the backpack and discovered the Walmart "National Cup" brand tea-bag as
well as the Walmart water bottle he'd taken with him on day one had all
reappeared inside it. So he kept repeating that statement anytime he
needed more of them.

Plus the little oxygen tank he had in the backpack (from days climbing
the Everest) never depleted!

Very magic, that mountain ...




Physfitfreak

unread,
Jan 20, 2024, 6:12:08 PMJan 20
to
On 1/20/2024 8:14 AM, Farley Flud wrote:
Hehe :) You got the right answer.

Here is the simple qbasic code for it:

phys = 11
mount = 100
n = 2

do
Phys = (n/(n-1))*phys + 11
mount = mount + 100
if (mount - phys) < 0 then exit do
n = n + 1
loop

print, "days climbed = "; n
print, "Physfit's height = "; phys
print, "mountain's height = "; mount


Piece of cake really. But after carefully writing the math before
embarking on coding it, as usual.

The fact that nobody else answered this says a lot about the validity of
what you've been telling about them here :)

With my qbasic version 1 (on my S20 ThinkStation with Win10, using
DOSBox-X emulation) which is very slow, it takes 7 seconds for the
output to appear.

The rest of the story:

Needless to say, after more than 13.5 years of climbing, Physfit's age
had taken him to a stage in life that he could not even think of going
back down and going home. So he dropped his last National Cup tea-bag
into the hot water and began thinking to himself, "Now when I look down
I can only see the lower parts of this mountain; no sign of an Earth
underneath it; so I will spend the rest of my life here at the summit,
inside my sleeping bag, watching all these stars above me ..."











rbowman

unread,
Jan 20, 2024, 6:47:13 PMJan 20
to
On Sat, 20 Jan 2024 16:47:40 -0600, Physfitfreak wrote:

> Very magic, that mountain ...

Der Zauberberg or the one in LA?

Physfitfreak

unread,
Jan 21, 2024, 12:39:37 AMJan 21
to
On 1/20/2024 5:47 PM, rbowman wrote:
> Der Zauberberg


I think I remember I tried to read that book in Persian when I was
around 17. It belonged to one of my elder brothers. I forged through a
bit but failed to continue and never gave it another try.

Either the translation, or the original itself, wasn't that
reader-friendly. For a teenager with ADHD anyway.




Farley Flud

unread,
Jan 21, 2024, 6:50:13 AMJan 21
to
On Sat, 20 Jan 2024 17:12:04 -0600, Physfitfreak wrote:

>
> phys = 11
> mount = 100
> n = 2
>
> do
> Phys = (n/(n-1))*phys + 11
> mount = mount + 100
> if (mount - phys) < 0 then exit do
> n = n + 1
> loop
>

One has to be careful with using a loop like this because
convergence may not occur until n attains an astronomically
huge value. Then the program may take YEARS to terminate but
way before then the precision of the variables would be
exceeded. Multi-precision variables could handle it but,
again, it may YEARS to terminate.

It's best to establish bounds through a direct analysis.

In this problem, the equation to be solved is this:

n*log(n-1) + n*gamma = 100/11*n - 1

Here, we are using the summation formula for the harmonic
series:

https://en.wikipedia.org/wiki/Harmonic_series_(mathematics)

This equation is impossible to solve analytically (at least
I can't see how). But we can plot each side to check for
an intersection:

https://postimg.cc/BPBp6rh8

https://postimg.cc/PNW22Dtt

The blue curve is the LHS and the red curve is the RHS.
The intersection occurs somewhere near 5000.

But we are lucky because, as I indicated, the intersection
could be at astronomically huge values.

We can solve numerically, however.

Using maxima/wxmaxima, the answer is easily found:

load(newton1)$

find_root(n*log(n-1)+577*n=100/11*n-1, n, 2, 10000);

4983.606531604496

DFS

unread,
Jan 21, 2024, 11:33:04 AMJan 21
to
the price of beer? climbing a mtn that magically grows each night?

Why don't you and Sand Chimp focus on something useful to science?

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

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

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


Should be a piece of cake for a braggart like you:

* "The stuff I do on my GNU/Linux machine is on par with the cutting
edge in HPC."

* "Intellectully, I am superior to 99.9999999% of the human
population and I use Linux nearly exclusivley."

(I'll conveniently ignore the 2 self-nukes in that last drool)

Now grab Sand Chimp by the gonads and get to it and leave a legacy
befitting a GuhNoo mama's boy.


Physfitfreak

unread,
Jan 21, 2024, 5:07:56 PMJan 21
to
Thanks for the nice treatment of it. I was keeping the task at the level
of this audience. Plus, it's not the first time I've proposed this
problem :-) So I knew it didn't pose that danger.

Back in the early 1980s, I wrote a letter to one of my cousins in Iran
who was studying mechanical engineering; and I used another story for
this problem; one of my elder brothers instead of Physfit, and the
location of the plant my brother and the cousin were employed at in
those years, instead of my house here, and so on. I used same numbers
though to avoid the dangers you were pointing at.

So I knew it had a solution easily obtainable by a simple tiny program
before writing that letter. The cousin was trying me with some
particularly difficult problems to check my physics abilities, all via
letters and snail mail, and that problem was one of the many that I
teased him with in response.

I think I got that idea by stumbling on something someone said in
Scientific American magazine.

Is that magazine still around? Nice math problems it had around end
pages of the magazine.

And speaking of the cousin, the last problem I wrote to him to solve was
a cruel one, and he never responded to that. It was our last
communication via letters too. The problem was seemingly an easy
geometry one, but unbeknownst to him, it was a historic one from an
Iranian master whose works even Newton had benefitted immensely from
(one of the four or five "giants" that he pointed at but never mentioned
their names).

I knew it was cruel, but the purpose was just teasing him, not dragging
him over the rugged ground. But unfortunately the latter proved to be
the case. And he stopped writing letters to me.

This simple problem that I sent here could be quickly checked to avoid
dangers in simpler ways as well (but not as definitive). One can measure
the first few days' climbing and see that the combined effect of the
daily 11 yard climbing and getting lifted up by the mountain for each
day is larger than for the day before it. So the effective climbing is
getting faster and faster in the future, and of course the effective
relative increase of the height of the summit is getting slower and
slower in the future (n/(n-1)). So with one getting larger and the
competing one getting smaller one can at least see that Physfit _will_
reach the summit before coding begins.





rbowman

unread,
Jan 21, 2024, 5:37:13 PMJan 21
to
On Sat, 20 Jan 2024 23:39:32 -0600, Physfitfreak wrote:

> Either the translation, or the original itself, wasn't that
> reader-friendly. For a teenager with ADHD anyway.

I doubt translating it to Persian added much. It's satirical but builds on
German culture from Goethe, Wagner, the Brothers Grimm, and contemporary
Weimar politics. Zauberberg is what Nietzsche called Mt. Olympus in 'The
Birth of Tragedy'.

I don't think any literature that references a particular culture
translates well. The superficial meaning comes through but much is lost.
As a trivial example I watched The Separation a few years ago.

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

I enjoyed the movie but I'm sure I missed many of the subtexts. One I
remember is when the father corrects his daughter who used an Arabic
phrase, telling her they are Persians and don't use that. That simple
dialog may be the distillation of centuries of conflict.

Physfitfreak

unread,
Jan 27, 2024, 1:10:35 AMJan 27
to
An ardent translator can make up for some of the stuff that's lost via
translation. The little twist and turns don't have to be in the
original, but should create an equivalent thought or feeling that's
understood by the reader and what the latter is familiar with; and the
closer it is to the original, the better. A lot of thoughts and feelings
between people of different languages are either the same or very
similar to each other. But only the top translators can do that; the
ones who are masters of both cultures and languages.



rbowman

unread,
Jan 27, 2024, 3:22:17 PMJan 27
to
On Sat, 27 Jan 2024 00:10:29 -0600, Physfitfreak wrote:

> An ardent translator can make up for some of the stuff that's lost via
> translation. The little twist and turns don't have to be in the
> original, but should create an equivalent thought or feeling that's
> understood by the reader and what the latter is familiar with; and the
> closer it is to the original, the better. A lot of thoughts and feelings
> between people of different languages are either the same or very
> similar to each other. But only the top translators can do that; the
> ones who are masters of both cultures and languages.

It might work with contemporary literature. Heidegger wrote on the
difficulty of translating the early Greek philosophers. Sure, you could
translate them into English, German, or whatever but what were they really
thinking?

Much of his work was concerned with what happened to the pre-Socratic
'physis' when Plato got his hands on it.

Chris Ahlstrom

unread,
Jan 27, 2024, 5:54:56 PMJan 27
to
rbowman wrote this copyrighted missive and expects royalties:
You need Naom Chomsky's "deep structure".

A simple example of it is how one can get confused by what someone else says
because they don't have the right context. Quite common in hearing what a
spouse says :-D

--
You will be a winner today. Pick a fight with a four-year-old.

Physfitfreak

unread,
Jan 27, 2024, 6:22:50 PMJan 27
to
On 1/20/2024 5:12 PM, Physfitfreak wrote:
> The rest of the story:
>
> Needless to say, after more than 13.5 years of climbing, Physfit's age
> had taken him to a stage in life that he could not even think of going
> back down and going home. So he dropped his last National Cup tea-bag
> into the hot water and began thinking to himself, "Now when I look down
> I can only see the lower parts of this mountain; no sign of an Earth
> underneath it; so I will spend the rest of my life here at the summit,
> inside my sleeping bag, watching all these stars above me ..."


Thus the story continues...:

Soon after such thoughts, Physfit got comfortable inside his sleeping
bag and began watching the amazing stars. He gradually fell into sleep,
dreaming that ... dreaming what? Things got confusing, then settled and
he found himself not at the summit of the magic mountain but inside a
strange structure of some sort, with high ceiling and a large narrow
slot across it. A facility of some sort. Before he began slowly walking
around, he noticed his shoes and dress looked weird, like belonging to
centuries back in Iran. Then he noticed the large device inside, which
pointed towards stars from that opening in the high ceiling. Rapidly,
his mind opened up, and he remembered where he was and who he was!

He was no Physfit.

From the magic mountain, he had stepped straight into the 13th century
Maragheh Observatory in northwest Iran, run by Nasiredding Tusi, right
inside the rein of Holaku Khan, the grandson of Chengiz!...

Now he knew who he was; in fact, who he'd always been. The sole pupil of
the master Tusi, Ghotbeddin Shirazi, who also worked in the observatory.
Not even a faint single memory of the magic mountain had left in him.

On that early morning hour, close to sunrise, Nasireddin Tusi and
Ghotbeddin Shirazi had called it a day an hour earlier, and had wrapped
up their works and were ready to leave.

Ghotbeddin turned to Tusi who was still at his large, long desk and with
a smile and a confident tone told him:

"Tonight I found two unique and special integers! They're in a
marvelous and unique way related to the date of Holaku's most beautiful
daughter's birthday :)"

Tusi who knew the date of that birthday from Ghotbeddin's previous
episodes of similar wishful and foolish mushy talk, without even lifting
his head answered,

"In what way?"

Ghotbeddin said,

"Each integer is made of three non-repeating digits and when you
divide the integers by the products of their own digits they give
exactly the month and the day of birthday of Holaku's beautiful
daughter, respectively! :)"

Tusi stayed silent for a few moments, then stood up and got ready to
leave. By the time the two made it to the gate of the observatory
compound to leave the premises and go home, Tusi turned to Ghotbeddin
and in a mildly teasing tone said,

"Sorry to disappoint you Shirazi, but there's nothing unique about
those three-digit integers of yours :)"

Ghotbeddin who knew Tusi enough to get a little nervous by such comments
quickly asked,

"What do you mean?"

Tusi right away gave him two other three-digit numbers that had exactly
the same properties! One would lead to the month (like Farvardin = 1,
Ordibehesht = 2, etc) and the other would lead to the day of the month
corresponding to the daughter's birthday by the same rules Ghotbeddin
had described a few minutes back. So the little personal party that
Ghotbeddin / Physfit had imagined for himself that night was, so soon,
over :)

What was the date of Holaku's daughter's birthday?

(sci.physics added)




Physfitfreak

unread,
Jan 27, 2024, 7:48:57 PMJan 27
to
I think the more one goes back in history, the more limited one's choice
of subjects to translate well, becomes. Eventually, one's probably left
with logic, or math, or physics, to translate at that level of accuracy
because their use is universal among humans, past and present.

But then, again, that level of accuracy isn't actually needed if the
work is not math or physics or logic. An ardent translator, can try the
same ways I described, and come up with a valuable work, close to what
the original was for its own people, but understandable by people
speaking the language it was translated in.

An example comes to my mind. There was this Ukrainian guy who became a
physician in France and wrote several works of fiction in French, some
of them heavily drawing from his own personal experiences of the mess
before and during and after WWII. One of his works (came out in mid
1950s) is a little fiction titled, "La Rouille" which translates to
"Rust" in English. But the ardent translator who turned it into Persian
(Shamloo) even changed its title! Yet, the book became a jewel among
Iranians and it is hard to find one who's not read the book. In its
Persian form, it is titled (direct translation into English) as, "Moss."
It is in fact the most popular book of the author (Herbert Le Porrier)
in Iran.

Now my point. In French _or_ English language, this book is next to
unknown. Even your AIs don't know about it. Your Wikipedia is as good as
a donkey about this work. Only French Wikipedia gives the basic information.

Europe, the Americas, Australia, and more, are clueless about this work.
If you dig it, you find that they at most know just the title, nothing
more. I don't think you can find any review on it. Yes, your entire "New
York" turns into a monkey in presenting a review of this work. Anna's
Archive is clueless about this particular work of this author.

But just about _every_ Iranian has read this work and has immensely
enjoyed it, all and all, for the first rate translation which that
master of literature had made. This is my point. A translator can do
more than the author in fact! But not every translator. It requires the
guy who can do stuff like that.


rbowman

unread,
Jan 27, 2024, 10:29:34 PMJan 27
to
On Sat, 27 Jan 2024 17:54:51 -0500, Chris Ahlstrom wrote:

> You need Naom Chomsky's "deep structure".

Somewhat related Chomsky getting testy about ChatGPT

https://www.commondreams.org/opinion/noam-chomsky-on-chatgpt

rbowman

unread,
Jan 27, 2024, 10:45:48 PMJan 27
to
On Sat, 27 Jan 2024 18:48:52 -0600, Physfitfreak wrote:

> In its Persian form, it is titled (direct translation into English) as,
> "Moss."
> It is in fact the most popular book of the author (Herbert Le Porrier)
> in Iran.

https://www.goodreads.com/author/list/44577.Herbert_Le_Porrier
https://www.goodreads.com/book/show/237562._

I assume that's the book since Persian script is opaque to me. What makes
it so popular?

I see the same thing with the genre known as Schweden Krimi in German.
Some of the authors like Stieg Larsson or Henning Mankell have become
relatively popular in English but the lesser known authors are translated
to German and that's where it ends. Fortunately the German versions are
usually available on Kindle.

Physfitfreak

unread,
Jan 27, 2024, 11:52:05 PMJan 27
to
Yes, that's the book I was talking about. As you see, there's no sign of
it in English. There's only the Persian translation that's been popular
enough to make it to that site.

The reason for its popularity is that it is a rather unique work that
could tell you everything about what happened to the occupied France,
even as a fiction. It was totally based on personal experiences of the
author, and expressed with no regards for what it implied for Europeans
and the French both. A work of art, really. I think a French author
would not write a work like that about France. To the French; i.e., even
to the French, some stuff should best be untold. But the author was
originally Ukrainian, so he treated the subject much more objectively.
Then this literature expert, Shamlou, noticed it and made a powerful
translation of it into Persian.

Shamlou's translations, as well as his own prose and poems, are among
the best in Iran. His grave is as often visited by Iranians as that of
Hafez. The two were closely of the same caliber as far as Persian
literature is concerned.

Sure, the original is always the best. But Iranians of my generation do
not know French. Shamlou's generation knew it. My father's French was
always better than his English, although his English was pretty good.

But as I said before, it is not just a matter of knowing the language.
It takes much more to translate the original into another language. It
is an art of its own.






Farley Flud

unread,
Jan 28, 2024, 7:31:44 AMJan 28
to
On Sat, 27 Jan 2024 17:22:47 -0600, Physfitfreak wrote:

>
> Tusi right away gave him two other three-digit numbers that had exactly
> the same properties! One would lead to the month (like Farvardin = 1,
> Ordibehesht = 2, etc) and the other would lead to the day of the month
> corresponding to the daughter's birthday
>
> What was the date of Holaku's daughter's birthday?
>

Month = 8 (Aban)

Day = 18


The corresponding integer pairs:

128, 672 --> 8

216, 432 --> 18

Chris Ahlstrom

unread,
Jan 28, 2024, 9:10:31 AMJan 28
to
Physfitfreak wrote this copyrighted missive and expects royalties:

> On 1/20/2024 5:12 PM, Physfitfreak wrote:
>
> < beaucoup snippage >
>
> What was the date of Holaku's daughter's birthday?
>
> (sci.physics added)

(sci.physics removed)

Accidental discovery (was going to use the 'ls' command):

% vim -RF
E27: Farsi support has been removed

Heh heh, and the Lie is Big, too:

--
One of the most striking differences between a cat and a lie is that a cat has
only nine lives.
-- Mark Twain, "Pudd'nhead Wilson's Calendar"

rbowman

unread,
Jan 28, 2024, 2:39:02 PMJan 28
to
On Sat, 27 Jan 2024 22:51:59 -0600, Physfitfreak wrote:

> The reason for its popularity is that it is a rather unique work that
> could tell you everything about what happened to the occupied France,
> even as a fiction. It was totally based on personal experiences of the
> author, and expressed with no regards for what it implied for Europeans
> and the French both.

Was Louis-Ferdinand Céline translated? His famous one is 'Journey to the
End of the Night' but the trilogy of 'Castle to Castle', Rigadoon', and
'North' are about his WWII experience. When the Allies landed he moved to
Germany and eventually to Denmark. The French tried to extradite him and
he was briefly in a Danish prison. The French eventually granted him
amnesty and he returned to France.

All three books are written in his unique style but it is a glimpse of a
different wartime experience.

Physfitfreak

unread,
Jan 28, 2024, 4:49:33 PMJan 28
to
No, Celine's works had a similar story to that of Le Porrier in Iran.
I'm glad you brought that up. Are you Iranian? Hehe :)

Another master of literature in Iran translated a work by Celine, titled
in its English translation as, "Death On Credit", and that's the one
among his works that became most popular in Iran. Celine's other works,
especially the first above that you mentioned, are also popular there,
but in my opinion not as much as this one for my generation. The
original came out in mid 1930s, a fiction. It is a work better known by
Europeans and in Americas compared to La Rouille which is simply
forgotten; at least for that one there is an English translation of it
available.

This other master, the translator (Sahabi), also, changed the title a
bit to make it work better for Iranians. The direct English translation
of its title in persian is, "Death In Payments." And I think it conveys
its meaning, even in the English language, better than the title in the
English translation. The Persian title is _exactly_ what Celine meant by
it. The title in the English translation is just the direct translation
of its title in French (Mort à crédit) which is not as good as what
Sahabi chose to use.

Sahabi, also, enjoyed many other masteries throughout his life.
Translating was just a side work for him, just like Shamloo, but with
the difference that Sahabi was a master artist while Shamloo was a
master in literature alone, a top word-smith, but all forms of it. The
latter even has a dictionary of "street-Persian" among many other odd
works. An amazing compilation without which much of the culture of
recent Iran would've gone to oblivion.

And this translation is one in which the readers would find many, many,
occasions of expressing stuff, and using words for doing that, which
were totally "No! No!" among publishers and authorities in Iran. And
yet, nobody dared stopping the work from coming out. Government or
non-government censurers, both yielded to it, because Sahabi had built
the story in a way that it couldn't be messed with. It was just a work
of art. Again, a work that some say was done better than the original by
Celine.

So going back to the subject, a translator may lose a lot of stuff in
the process of translating from the original, but also can add to it in
some ways permissible. It is not always a one-way process of
deterioration of the original. It can even get better than the original
:) But it all depends on who it is that's doing the translation.


Physfitfreak

unread,
Jan 28, 2024, 5:10:24 PMJan 28
to
On 1/28/2024 3:49 PM, Physfitfreak wrote:
>
> So going back to the subject, a translator may lose a lot of stuff in
> the process of translating from the original, but also can add to it in
> some ways permissible. It is not always a one-way process of
> deterioration of the original. It can even get better than the original
> :) But it all depends on who it is that's doing the translation.


A stark historic example of this fact is the work, "Almagest" that
kharazmi translated from Greek into Arabic (language of science of his
time). Kharazmi made many attempts to explain better the concepts that
Ptolemy either had not explained enough, or had made small mistakes in.
For this reason, the translation of Almagest from Arabic to Latin was
used among scientists and astronomers more often than the original Greek
one by Ptolemy when it was discovered at last. This original had been
lost for like a thousand years. But when discovered and read by experts,
it did not quite match the quality of Kharazmi's translation of it :)

Because the "translator" was not some dork who knew Greek. He was a
master of its own, and translating was just a side activity for him.


Physfitfreak

unread,
Jan 28, 2024, 5:44:26 PMJan 28
to
Damn you. Dont' give the codes yet :) Give others a chance.

You didn't solve it by hands, did you!... I think a program will do that
much faster, at least for me. For doing it by hand I'd have to go back
to my college algebra again :-)

But do at least tell us you did it by hand or by a program.


rbowman

unread,
Jan 28, 2024, 7:40:51 PMJan 28
to
On Sun, 28 Jan 2024 15:49:29 -0600, Physfitfreak wrote:

> Another master of literature in Iran translated a work by Celine, titled
> in its English translation as, "Death On Credit", and that's the one
> among his works that became most popular in Iran.

amazon.com/dp/0811200175

In the US the New Directions edition was titled' Death on the Installment
Plan'. That and Journey are the most widely known. Some of his later books
aren't as popular as it became apparent he didn't like Jews very much. No
surprise; that's the default setting in France.


Physfitfreak

unread,
Jan 28, 2024, 11:06:07 PMJan 28
to
On 1/28/2024 6:40 PM, rbowman wrote:
> amazon.com/dp/0811200175
>
> In the US the New Directions edition was titled' Death on the Installment
> Plan'. That and Journey are the most widely known. Some of his later books
> aren't as popular as it became apparent he didn't like Jews very much. No
> surprise; that's the default setting in France.
>
>


Publishers must've intervened to change the title of the same
translation to better convey the meaning. This same translation was
before, titled as I said in last post:

https://www.amazon.com/Death-Credit-Louis-Ferdinand-Celine/dp/1847490417

Celine wanted the title to convey a sort of death that doesn't come at
once or the life that's not going out of the body at once, but in
chunks, piece by piece paid out to others who want it and own it
beforehand, and according to a plan before it even starts, until the
death is complete. The worst kind of trap one can find himself in while
being "free" in the society! That kind of situation.

Some are right now experiencing it. Including some of the Americans.
Especially the ones who should not be in prison. Find and read the
remarks that the guy who created the darknet is making inside prison. A
very bright guy, seeing his life getting thrown away in chunks before
his own eyes. His name is Ross Ulbricht. Funny that he also studied
physics, and did it in the same school that I did here (UTD) :) But he
was one generation after me. A very capable and bright guy, never to
come out again. It's just crazy. It is just what the title of Celine
work says.

I think "Death by Installments" is closest to that thought. But I still
think the one in Persian which Sahabi chose is the best match to Celine's.


Farley Flud

unread,
Jan 29, 2024, 3:29:00 AMJan 29
to
On Sun, 28 Jan 2024 16:44:22 -0600, Physfitfreak wrote:

>
> But do at least tell us you did it by hand or by a program.
>

I used a small C program to "brute force" the solution.

There may be a way to solve it with number theory, but I
don't know very much about number theory.

Anyway, for three-digit, non-repeating integers (also with
no digit being 0) there are 9*8*7 = 504 possibilities. Only
a crazy person would do it "by hand."

Physfitfreak

unread,
Jan 30, 2024, 2:25:26 AMJan 30
to
By saying "by hand" I meant to go like this: There are 8 unknowns and 16
inequalities :)

And take that approach, and choose only integers in the solution areas.
It could be neat to try.

I haven't solved it either way. This is from years back, so I've
forgotten how I solved it. As soon as I get time I'll give it a try.
Then I can say for sure if your solution was good enough or not.

At this point I'm not even sure the problem is well-posed. I know that
years ago when I made this problem I was under the impression that it
was well-posed.

DFS

unread,
Jan 31, 2024, 5:01:27 PMJan 31
to
On 1/29/2024 3:28 AM, Farley Flud wrote:
> On Sun, 28 Jan 2024 16:44:22 -0600, Physfitfreak wrote:
>
>>
>> But do at least tell us you did it by hand or by a program.
>>
>
> I used a small C program to "brute force" the solution.
>
> There may be a way to solve it with number theory, but I
> don't know very much about number theory.


Like you said before: "Your method is know as 'brute force' and is
typical for someone with no mathematical skills."


Physfitfreak

unread,
Jan 31, 2024, 6:34:00 PMJan 31
to
This "computation" was way too simple to bother with anything but brute
force.

You, a cro-magnon who doesn't want to be a cro-magnon, who's ashamed of
being cro-magnon, and who has to finger himself every time he remembers
he's a cro-magnon, can you show a computer program to do solve the
proposed problem?


Physfitfreak

unread,
Jan 31, 2024, 7:18:38 PMJan 31
to
On 1/29/2024 2:28 AM, Farley Flud wrote:
> There may be a way to solve it with number theory, but I
> don't know very much about number theory.


Come to think of it, I may have concocted this problem from a math
number theory discussion in Scientific American. For sure, it was many
years ago. That's the only thing about it that I'm sure of :)

When I get time (for some reason these days various unusual chores are
popping up on me - each requiring a good part of a day's work), I'd like
to solve this both with a program and "with hand" the way I described
it. I would enjoy doing it, but deadlines are coming up and I got other
bullshit stuff to do on top of them.


Stéphane CARPENTIER

unread,
Feb 2, 2024, 4:49:51 PMFeb 2
to
Le 28-01-2024, Physfitfreak <Physfi...@gmail.com> a écrit :
> On 1/28/2024 6:31 AM, Farley Flud wrote:
>
> You didn't solve it by hands, did you!...

Of course he didn't. He solved it by either google or stackoverflow.

--
Si vous avez du temps à perdre :
https://scarpet42.gitlab.io

Stéphane CARPENTIER

unread,
Feb 2, 2024, 4:54:46 PMFeb 2
to
Le 31-01-2024, Physfitfreak <Physfi...@gmail.com> a écrit :
> On 1/31/2024 4:01 PM, DFS wrote:
>> On 1/29/2024 3:28 AM, Farley Flud wrote:
>>> On Sun, 28 Jan 2024 16:44:22 -0600, Physfitfreak wrote:
>>>
>>>>
>>>> But do at least tell us you did it by hand or by a program.
>>>>
>>>
>>> I used a small C program to "brute force" the solution.
>>>
>>> There may be a way to solve it with number theory, but I
>>> don't know very much about number theory.
>>
>>
>> Like you said before: "Your method is know as 'brute force' and is
>> typical for someone with no mathematical skills."
>
> This "computation" was way too simple to bother with anything but brute
> force.

You didn't understood his answer. DFS doesn't care about the way a
solution is found. But, FF/LP/NV/DG/whatever does care and he said using
brute force is bad when he is using it.

DFS

unread,
Feb 2, 2024, 7:17:48 PMFeb 2
to
On 2/2/2024 4:54 PM, Stéphane CARPENTIER wrote:
> Le 31-01-2024, Sand Chimp <eek_a...@gmail.com> a écrit :
>> On 1/31/2024 4:01 PM, DFS wrote:
>>> On 1/29/2024 3:28 AM, Larry Piet wrote:
>>>> On Sun, 28 Jan 2024 16:44:22 -0600, Sand Chimp wrote:
>>>>
>>>>>
>>>>> But do at least tell us you did it by hand or by a program.
>>>>>
>>>>
>>>> I used a small C program to "brute force" the solution.
>>>>
>>>> There may be a way to solve it with number theory, but I
>>>> don't know very much about number theory.
>>>
>>>
>>> Like you said before: "Your method is know as 'brute force' and is
>>> typical for someone with no mathematical skills."
>>
>> This "computation" was way too simple to bother with anything but brute
>> force.


The parameters of your problem led to a quick computer solution that
made the problem seem simple, but as Feeb noted, some series never
converge and much time could be wasted.

So simplicity definitely doesn't preclude searching for a better
solution, that may be more complicated.

eg, computing Fibonacci numbers is much simpler than the harmonic series
calculations, but the standard Fibonacci recursive "brute force" method
is extremely costly and slow. Thus the Binet formula is employed.

========================================================================
//FIBONACCI SERIES
//0,1,1,2,3,5,8,13,21,34,55,89...

//COMPILE
//gcc -Wall -std=gnu99 -O3 Fibonacci.c -o Fib -lm

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>

#define BILLION 1E9

long double Fibbrute(int num) {
long double b = 0;
if(num==0) {b = 0;}
else if(num==1) {b = 1;}
else if(num>=2) {b = Fibbrute(num-1) + Fibbrute(num-2);}
return b;
}

long double FibBinet(int num) {
long double b = (pow(1+sqrt(5),num) - pow(1-sqrt(5),num)) /
(pow(2,num) *
sqrt(5));
return b;
}


int main(int argc, char *argv[]) {
int i;
long double j;
struct timespec start, end;
double et;

char *Fibtype = argv[1];
int low = atoi(argv[2]);
int hi = atoi(argv[3]);

if (strcmp(Fibtype,"Recursive")==0) {
printf("Recursive\n");
for (i = low; i <= hi; i++) {
clock_gettime(CLOCK_MONOTONIC_RAW, &start);
j = Fibbrute(i);
clock_gettime(CLOCK_MONOTONIC_RAW, &end);
et = (end.tv_sec-start.tv_sec) + ((end.tv_nsec-start.tv_nsec) /
BILLION);
printf("Fibonacci %d = %.Lf (%.2f seconds)\n", i, j, et);
}
}


if (strcmp(Fibtype,"Binet")==0) {
printf("\nBinet forumula\n");
for (i = low; i <= hi; i++) {
clock_gettime(CLOCK_MONOTONIC_RAW, &start);
j = FibBinet(i);
clock_gettime(CLOCK_MONOTONIC_RAW, &end);
et = (end.tv_sec-start.tv_sec) + ((end.tv_nsec-start.tv_nsec) /
BILLION);
printf("Fibonacci %d = %.Lf (%.8f seconds)\n", i, j, et);
}
}

return(0);
}
========================================================================


If you use the Recursive option, be in for long waits, while the Binet
formula is instantaneous.


On my mid-range system I get:

$ ./Fib Recursive 50 60
Recursive
Fibonacci 50 = 12586269025 (0.65 seconds)
Fibonacci 51 = 20365011074 (0.95 seconds)
Fibonacci 52 = 32951280099 (1.39 seconds)
Fibonacci 53 = 53316291173 (2.04 seconds)
Fibonacci 54 = 86267571272 (2.98 seconds)
Fibonacci 55 = 139583862445 (4.38 seconds)
Fibonacci 56 = 225851433717 (6.43 seconds)
Fibonacci 57 = 365435296162 (9.42 seconds)
Fibonacci 58 = 591286729879 (13.82 seconds)
Fibonacci 59 = 956722026041 (20.27 seconds)
Fibonacci 60 = 1548008755920 (29.70 seconds)

That's a lot of waiting.


$ ./Fib Binet 50 60
Binet forumula
Fibonacci 50 = 12586269025 (0.00002384 seconds)
Fibonacci 51 = 20365011074 (0.00000021 seconds)
Fibonacci 52 = 32951280099 (0.00000026 seconds)
Fibonacci 53 = 53316291173 (0.00000020 seconds)
Fibonacci 54 = 86267571272 (0.00000019 seconds)
Fibonacci 55 = 139583862445 (0.00000008 seconds)
Fibonacci 56 = 225851433717 (0.00000013 seconds)
Fibonacci 57 = 365435296162 (0.00000008 seconds)
Fibonacci 58 = 591286729879 (0.00000014 seconds)
Fibonacci 59 = 956722026041 (0.00000014 seconds)
Fibonacci 60 = 1548008755920 (0.00000036 seconds)



> You didn't understood his answer. DFS doesn't care about the way a
> solution is found. But, FF/LP/NV/DG/whatever does care and he said using
> brute force is bad when he is using it.

Feeb is big on 'rules for thee but not for me'.


Also big on bullshit:

Feeb: "I know EVERYTHING"
Feeb: "I don't know very much about number theory."



Physfitfreak

unread,
Feb 3, 2024, 5:00:35 AMFeb 3
to
On 1/27/2024 5:22 PM, Physfitfreak wrote:
> Tusi right away gave him two other three-digit numbers that had exactly
> the same properties! One would lead to the month (like Farvardin = 1,
> Ordibehesht = 2, etc) and the other would lead to the day of the month
> corresponding to the daughter's birthday by the same rules Ghotbeddin
> had described a few minutes back. So the little personal party that
> Ghotbeddin / Physfit had imagined for himself that night was, so soon,
> over :)


Thus the story continues...

The two scientists got out and locked the gate and left.

That day, in the evening, a party was to hold in Holaku's Summer
residence not that far from Maragheh. And the two were both invited!

Ghotbeddin got home and hit the sack fast and early to wake up fully
rested before attending the party. He couldn't be contained inside his
own skin, when thinking about the prospect of seeing Holaku's daughter
again within that same day...

As he slowly drifted off into sleep he dreamed that wherever he was, he
was actually already in that party but had just noticed it! He didn't
get time to think how it happened and why he'd only now realized where
he'd been all this time. Holaku was sitting on a throne across the huge
room and some of the vazirs were here and there chatting. But he knew
that he had not yet seen the daughter, so he made himself sure he'll
stay until she shows up. Also, he knew that he and Holaku both were
waiting for Tusi to arrive, because Holaku had something to ask from him.

But there was no sign of Tusi. At his home, he had come up with an idea
which needed the use of some tables of numbers kept at the observatory,
and he had chosen to go to the observatory in the evening, not even to
Hulaku's party where he was invited!

So after some time, at some point Holaku signaled to have a talk with
Ghotbeddin. A servant and one of the vazirs immediately came over to
Ghotbeddin and together walked to where Holaku was sitting.

Holaku to Ghotbeddin:

"They tell me you are a very smart man to be in the observatory,
helping someone like Tusi. Do you think you are as smart as Tusi?"

Ghotbeddin made a faint smile and said:

"Your Majesty, I am not blessed with as much talent as God has
bestowed upon Your Majesty _or_ Tusi."

Holaku:

"I have a task for Tusi to accomplish, but in his absence I want you
to do it."

Ghotbeddin:

"Your Majesty's wish is my utmost desire."

Holaku:

"In each of my parties, a session is always included in which a
chessboard is placed on the floor, with no chess pieces on it. There is
a contest, and the winner is blindfolded and given two random chess
pieces of same color - but not any pawns - out of my pocket, to place
somewhere on the chessboard by the winner, in two of the squares. Then
the blindfold is removed and the winner will look at the chessboard and
counts the number of different moves he can make with the chess pieces
from the squares that they are in. The winner will get as many gold
coins from me as that count is. If I know in advance which two pieces
will be given to the winner, I need to know how many gold coins I should
bring with me to the party, so I could never find myself with not enough
coins to give to the winner, and never carry with me even one gold coin
that would never be needed to be given to the winner. Find how many
coins I should bring with me to the party."

Ghotbeddin:

"Your Majesty's wish will undoubtedly get fulfilled."

How many gold coins should Holaku Khan take with him to his parties?



Farley Flud

unread,
Feb 3, 2024, 11:19:06 AMFeb 3
to
On Sat, 3 Feb 2024 04:00:30 -0600, Physfitfreak wrote:

>
> Thus the story continues...
>
> How many gold coins should Holaku Khan take with him to his parties?
>

I'll pass. I don't know how to play chess. I think that, like all
games, chess is stupid and boring.

It reminds of the time I enrolled in a computer science class at
the university. Our very first assignment was to write a program
that kept score of a bowling game.

Bowling? I don't fucking know how to bowl. I never fucking went
bowing in my entire fucking life.

So now I first gotta learn the rules of the game of bowling and
then write the program. I said: "Fuck that!" I just dropped the
course. I'll enroll with an instructor who is progressive and sane.

DFS

unread,
Feb 3, 2024, 11:41:03 AMFeb 3
to
On 2/2/2024 7:17 PM, DFS wrote:
>>>>> On Sun, 28 Jan 2024 16:44:22 -0600, Sand Chimp wrote:
>>>>>
>>>>>>
>>> This "computation" was way too simple to bother with anything but brute
>>> force.

> eg, computing Fibonacci numbers is much simpler than the harmonic series
> calculations, but the standard Fibonacci recursive "brute force" method
> is extremely costly and slow.  Thus the Binet formula is employed.

Or you use this extremely fast brute-force method: pre-populate an array
with the Fibonacci numbers from 0 to N. It's about as fast as the Binet
formula - but it's actually more correct, since the Binet formula relies
on the precision of the sqrt(5).

=======================================================================

//COMPILE
//gcc -Wall -std=gnu99 -O3 Fibonacci.c -o Fib -lm

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>

int main(int argc, char *argv[]) {
int i;
struct timespec start, end;
double et;

int low = atoi(argv[1]);
int hi = atoi(argv[2]);

clock_gettime(CLOCK_MONOTONIC_RAW, &start);

long double *Farray = malloc((hi + 1) * sizeof(long double));
for (i = 0; i <= hi; i++) {
if(i==0) {Farray[i] = 0;}
else if(i==1) {Farray[i] = 1;}
else if(i>=2) {Farray[i] = Farray[i-1] + Farray[i-2];}
}
for (i = low; i <= hi; i++) {
printf("Fibonacci %d = %.Lf\n", i, Farray[i]);
}

clock_gettime(CLOCK_MONOTONIC_RAW, &end);
et = (end.tv_sec-start.tv_sec) + ((end.tv_nsec-start.tv_nsec)/1E9);
printf("%.8f seconds\n", et);

free(Farray);
return(0);
}
=======================================================================


$ ./Fib 10000 10000
Fibonacci 10000 =
33644764876431783337262952613817637625229469942184118735495552216602061536217341818627149116984952349519390497344701696741933112984689952173588604968251546055527572946271490132515369934789123193382744900183497988764290618464122776520567087489368586385503635361245930634568340857449318308576412077472755747233938138345827443350926734762619602821442846566648827371918745309399412426040077914636747232443711591065325762404713792346070417366277737155532731409213917909873081142358447338484840333953463883253988782222040273055732535087462527499340083771920709136632413461078215097556698713674037903885240353549341452751583638605591854208249720510131862875052478850595640733413441381562004437859327806798430918962698309853023364479022494827705651212315616526784449087106522966559995852113571643683513204363872360889721347466906428608550211618778604262630409660082212659482658909400908738190097560755731044169859227519432247112849371000664609017987408466476775064767189066079118632284980287775721005249084965661694775769153059231446465557499825138752050519720707155488718050592417156777589525370620729437792430449856295746196507635957570462496208097570657570789309288519964020514618311952531947962859548854335610669647999399349728133713604497953794313311987062809817418425797636369901169043079567809260765221238593076617485663685280543059382846507547174885433188225693563941306654616427686438920336509098253219599796503034867906791345461220555862703653952638078077967889222241657993029553025294391149023511255404242069474007708668336078835294557756728473882839801539912942027214648166112862175009599880562369202237302328512819587986993874339187915427797272891139812920337896354920554999623151702554847963100911418782881378701409582923396695194563015653584439792720296758578054476613718761992114689400942978388470781387313800294054286371847353420284074909564876051387501560022008325167623580090109033955897935513021907991870866526175985233112323460090307674541596341172255487145592168651676845954314300735531547344635695242887995601514335173698784080214249513581747349008988088834033301305035849728
0.00034628 seconds

DFS

unread,
Feb 3, 2024, 11:58:01 AMFeb 3
to
On 2/3/2024 5:00 AM, Physfitfreak wrote:

> Holaku:
>
>    "In each of my parties, a session is always included in which a
> chessboard is placed on the floor, with no chess pieces on it. There is
> a contest, and the winner is blindfolded and given two random chess
> pieces of same color - but not any pawns - out of my pocket, to place
> somewhere on the chessboard by the winner, in two of the squares. Then
> the blindfold is removed and the winner will look at the chessboard and
> counts the number of different moves he can make with the chess pieces
> from the squares that they are in. The winner will get as many gold
> coins from me as that count is. If I know in advance which two pieces
> will be given to the winner, I need to know how many gold coins I should
> bring with me to the party, so I could never find myself with not enough
> coins to give to the winner, and never carry with me even one gold coin
> that would never be needed to be given to the winner. Find how many
> coins I should bring with me to the party."


> How many gold coins should Holaku Khan take with him to his parties?

2




DFS

unread,
Feb 3, 2024, 12:13:48 PMFeb 3
to
On 2/3/2024 11:57 AM, DFS wrote:
I almost said "Unsolvable, because they were random pieces in a random
placement". But I figured it was a chimpish trick question, and read it
again and noticed your problem didn't ask for the number of possible
moves, or the direction, both of which would be impacted by the placement.

You specified non-pawns because pawns can't move again if placed on the
opposing side, but all other pieces can move no matter where they're
placed on the board, even if another piece is directly adjacent.

So you have 2 non-pawns, each of which can make 1 move.


Farley Flud

unread,
Feb 3, 2024, 12:38:25 PMFeb 3
to
On Sat, 3 Feb 2024 11:40:56 -0500, DFS wrote:

>
> //COMPILE
> //gcc -Wall -std=gnu99 -O3 Fibonacci.c -o Fib -lm
>

Oh my fucking god! What an absolute horrid piece of fucking
shit!

>
> long double *Farray = malloc((hi + 1) * sizeof(long double));
>

Long doubles! Oh my fucking god! The long double type has a decimal
precision of about 20 places. If the Fibonacci number exceeds 20 places
it will break down -- and that is EXACTLY what we see.

Your abominable junk gives for ./Fib 98 98:

Fibonacci 98 = 135301852344706746048

The correct answer is: 135301852344706746049

You shit answer is wrong in the last place.

Every number above 97 will be WRONG, WRONG, WRONG.

Example:

Fibonacci 1000 = 43466557686937456441067806760621305207538765975592846737908149375407140100631754593595544200722179756589278396980379469175286581878650684127526345486516252019213839733161955037779772590856692113986334761156608

The CORRECT answer is:

43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875

After the 18th decimal place your answer is TOTALLY FUBAR.


Congratulations!

You win the award for the stupidest dumbfuck C program in the
history of computing.


Farley Flud

unread,
Feb 3, 2024, 12:48:26 PMFeb 3
to
On Sat, 03 Feb 2024 17:38:21 +0000, Farley Flud wrote:

>
> Every number above 97 will be WRONG, WRONG, WRONG.
>

I make boo boo!

Every number above 96 will be DEAD FUCKING WRONG.

Ha, ha, ha, ha, ha, ha, ha, ha, ha!

Physfitfreak

unread,
Feb 3, 2024, 5:17:43 PMFeb 3
to
Hahhahah :) Makes sense.

I get that feeling when in public media somebody who's supposed to
explain something for the general people uses "football" terms in his
words. Imagine Biden, while at the podium speaking, turning sideways and
beginning peeing on the floor, then turning back towards the audience
and continuing the talk as if nothing inappropriate was done. Or, ...
suddenly throw in a sentence in Mayan language... then continue in
English. Hahhahah :)

It amounts to being on the left side of the intelligence curve, where
half of the Americans happily reside. RIP Carlin... I hear you.

I used the chess game in this story cause it is a much, much more
universal pastime, and very ancient. So ancient that terms associated
with it in German and Persian are almost the same! It goes that far back.

And I used only the movement types of its pieces, and nothing else. No
other rules whatsoever. And I assumed everybody knows that chessboard is
an 8 squares by 8 squares board, consisting of 64 squares on which these
pieces can move in their own ways if not blocked by another piece.

This story gives an opportunity - for the code monkeys really - to try
their use of loops within loops to solve clear but involved logical
situations. Several arrays are involved.

I intended to later add one more piece to the two! :-) And then one
more, and then one more... Then one would get very close to do what
computer chess developers do.

But if it has to stop in this forum, before even it started, then so be it.

If my memory serves me right, that's how Ken Thompson, the other of the
duo with Dennis Ritchie, who together developed Unix, became expert in
programming and OSs. I think he wanted to make his chess program faster
and faster. I think that was the whole deal for him behind all that work
:) He won some chess computer competitions too, I think.

But I still challenge everybody in this forum other than Farley, to
salvage their fucked up images as "programmers", by writing the baby
program that solves this problem in its most simple form, which is two
chess pieces. It is simple enough to be done by any code monkey, and yet
involved enough to be too time-consuming to do it "by hand".

So, each of you in COLA, are you even a code monkey? Farley says you
are, but I even doubt that. I think you're just foolish little loud
mouths as far as programming is concerned. So far, only Farley has
proved himself as a real programmer.

Speaking of a computer science class, the only one I took was in Summer
1979 to learn PL/I. No other languages were being taught in that Summer.
It was actually a graduate course in computer science, so a lot of
programming knowledge in the students were assumed by the professor in
its covering of that language. But for me it was the first touch of a
programming language. Thanks god the text was excellent. A dictionary
size big black book of almost 1000 pages. That was my source really, not
what was being discussed in the classroom. My understanding of the
verbal English hadn't matured yet and I'd muss most of what the prof was
so elaborately explaining. I suspect that the aim of that course was to
prepare the students on _creating_ better languages. But the text chosen
was very comprehensive, covering every programming skill, all the
sensitive areas, all the usual mistakes, all the important concepts
associated to programming in general and in that language. I read and
understood that book from begin to end!

There was also a 13 or so year old kid in the classroom sitting with his
father, and asking most of the questions! One of those who even in
middle school knew how to program well and had a talent for it.

The course was 5 semester hours! A heck of a lot of material packed into
a month and a half Summer term.




DFS

unread,
Feb 3, 2024, 6:08:25 PMFeb 3
to
On 2/3/2024 12:38 PM, Farley Flud wrote:
> On Sat, 3 Feb 2024 11:40:56 -0500, DFS wrote:
>

> Long doubles! Oh my fucking god! The long double type has a decimal
> precision of about 20 places. If the Fibonacci number exceeds 20 places
> it will break down -- and that is EXACTLY what we see.

I figured not using a BigNum library would cause trouble.


> Your abominable junk gives for ./Fib 98 98:
> Fibonacci 98 = 135301852344706746048
> The correct answer is: 135301852344706746049

> Fibonacci 1000 = 43466557686937456441067806760621305207538765975592846737908149375407140100631754593595544200722179756589278396980379469175286581878650684127526345486516252019213839733161955037779772590856692113986334761156608
> The CORRECT answer is:
> 43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875


Which website did you get the correct answers from? Cause they sure
didn't come from your own code.



10 lines of Python, no need to import bignum modules
-------------------------------------------------------------
import sys
Farray = []

lo,hi = int(sys.argv[1]), int(sys.argv[2])
for i in range(hi+1):
if i >=2:
Farray.append(Farray[i-1] + Farray[i-2])
else:
Farray.append(i)

for i in range(lo,hi+1):
print("F(%d) = %d (%d digits)" % (i, Farray[i], len(str(Farray[i]))))
-------------------------------------------------------------


F(98) = 135301852344706746049 (21 digits)

F(100) = 354224848179261915075 (21 digits)

F(1000) =
43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875
(209 digits)

F(10000) =
33644764876431783266621612005107543310302148460680063906564769974680081442166662368155595513633734025582065332680836159373734790483865268263040892463056431887354544369559827491606602099884183933864652731300088830269235673613135117579297437854413752130520504347701602264758318906527890855154366159582987279682987510631200575428783453215515103870818298969791613127856265033195487140214287532698187962046936097879900350962302291026368131493195275630227837628441540360584402572114334961180023091208287046088923962328835461505776583271252546093591128203925285393434620904245248929403901706233888991085841065183173360437470737908552631764325733993712871937587746897479926305837065742830161637408969178426378624212835258112820516370298089332099905707920064367426202389783111470054074998459250360633560933883831923386783056136435351892133279732908133732642652633989763922723407882928177953580570993691049175470808931841056146322338217465637321248226383092103297701648054726243842374862411453093812206564914032751086643394517512161526545361333111314042436854805106765843493523836959653428071768775328348234345557366719731392746273629108210679280784718035329131176778924659089938635459327894523777674406192240337638674004021330343297496902028328145933418826817683893072003634795623117103101291953169794607632737589253530772552375943788434504067715555779056450443016640119462580972216729758615026968443146952034614932291105970676243268515992834709891284706740862008587135016260312071903172086094081298321581077282076353186624611278245537208532365305775956430072517744315051539600905168603220349163222640885248852433158051534849622434848299380905070483482449327453732624567755879089187190803662058009594743150052402532709746995318770724376825907419939632265984147498193609285223945039707165443156421328157688908058783183404917434556270520223564846495196112460268313970975069382648706613264507665074611512677522748621598642530711298441182622661057163515069260029861704945425047491378115154139941550671256271197133252763631939606902895650288268608362241082050562430701794976171121233066073310059947366875
(2090 digits)

DFS

unread,
Feb 3, 2024, 6:24:45 PMFeb 3
to
On 2/3/2024 12:48 PM, Lameass Larry wrote:
> On Sat, 03 Feb 2024 17:38:21 +0000, Larry Pietraskiewicz wrote:
>
>>
>> Every number above 97 will be WRONG, WRONG, WRONG.
>>
>
> I make boo boo!

No way!


> Every number above 96 will be DEAD FUCKING WRONG.

So F(97) is off by 1 in:

83 quintillion
621 quadrillion
143 trillion
489 billion
848 million
422 thousand
and 877

Congratulations! You should spend a month writing a paper about it.


> Ha, ha, ha, ha, ha, ha, ha, ha, ha!

You're worse than Cackling Kamala Harris.

DFS

unread,
Feb 3, 2024, 7:58:38 PMFeb 3
to
On 2/3/2024 5:17 PM, SandChimp wrote:

> It amounts to being on the left side of the intelligence curve, where
> half of the Americans happily reside. RIP Carlin... I hear you.

Can you imagine what the intelligence curve of you 97-IQ Iranian chimps
looks like?



> But I still challenge everybody in this forum other than Farley, to
> salvage their fucked up images as "programmers", by writing the baby
> program that solves this problem in its most simple form, which is two
> chess pieces. It is simple enough to be done by any code monkey, and yet
> involved enough to be too time-consuming to do it "by hand".

No programming necessary whatsoever. The answers are either 2, or there
can be no answer to the question as you posed it.

--------------------------------------------------------------------------
"In each of my parties, a session is always included in which a
chessboard is placed on the floor, with no chess pieces on it. There is
a contest, and the winner is blindfolded and given two random chess
pieces of same color - but not any pawns - out of my pocket, to place
somewhere on the chessboard by the winner, in two of the squares. Then
the blindfold is removed and the winner will look at the chessboard and
counts the number of different moves he can make with the chess pieces
from the squares that they are in. The winner will get as many gold
coins from me as that count is. If I know in advance which two pieces
will be given to the winner, I need to know how many gold coins I should
bring with me to the party, so I could never find myself with not enough
coins to give to the winner, and never carry with me even one gold coin
that would never be needed to be given to the winner. Find how many
coins I should bring with me to the party."
---------------------------------------------------------------------------

My initial answer was that the 2 chess pieces can only ever make 1 move
each, so he needs to bring exactly 2 gold coins.

But I see you did specify "number of different moves he can make". But
you also said the pieces are placed randomly on the board. Thus the
question "Exact number of coins" cannot be answered because pieces
placed in the middle of the board can move in all directions, but pieces
placed on the edges (ranks 1 and 8, files a and h) cannot.

eg a bishop on ranks 2-7, files b-g has 3 or 4 possible moves. A bishop
on rank 1 or 8 has 1 or 2 possible moves.

Similarly, a rook on ranks 2-7, files b-g has 3 or 4 possible moves, but
a rook on rank 1 or 8 has 1 or 2 possible moves.

You also didn't specify whether or not a blocking piece could first be
moved to allow the blocked piece to move (put bishops on a1 and b2. The
bishop at b2 has to move before a1 can move).

So, given random placement, you could never calculate the number of
possible moves of the 2 pieces.

Try again.



> So, each of you in COLA, are you even a code monkey? Farley says you
> are, but I even doubt that. I think you're just foolish little loud
> mouths as far as programming is concerned.

I've been here since mid-2004. The ONLY true programming loudmouth that
has been in cola for nearly 20 years is Lameass Larry Piet. Since early
2015 he frequently brags about his programming skillz, which are in
reality mediocre at best. It's a joke.


Here's some of the nutty brags he made about himself:

ALWAYS RIGHT
ARCHITECT
All code is ABSOLUTELY PERFECT
COMPOSER
CREATIVE man
EXPERT in image processing and audio processing
INFALLIBLE
INNOVATOR
NEVER loses
REAL MAN
a highly competent TECHNICAL MAN
as superior as it is possible to get
assembly language genius
began programming in machine language
board-certified psychiatrist
builds homemade audio equipment that beats ALL commercial equipment
built a fantastic website
businessperson
C programmer extraordinaire
can do anything and everything [software-related]
can program ANYTHING.
computer scientist
computing virtuoso
consultant for the US Army
could've saved NASA with his perfect simulation
electrical engineer
ex heroin addict
expert in *all* aspects of both GNU/Linux and Windows
Give me C, simple and unchanging C, and I shall bury these
Microslop cronies.
I can program ANYTHING
keyboardist
knows EVERYTHING
magnificent programming prowess
material scientist
mathematician
mechanical engineer
music producer
NEVER incorrect
perfect in every way
Perl guru
programming wizard
research scientist
straight A college and grad student
super engineer
talented artist
the pinnacle of intellectual and physical perfection
three peer-reviewed publications
true innovator
went to a REAL institution of higher learning
worldly and seasoned programmer
worth (at least) 5 billion people
worth 10 billion people
worth at least a billion people

babble babble



> So far, only Farley has proved himself as a real programmer.

No such thing, and Feeb has only proven himself to be a lying lout and
IT failure and programming nincompoop. The fraud couldn't even sort a
list of first-last names using C.

You're his 2nd cola groupie (Slimer was his first). You should have
more self-esteem.



> There was also a 13 or so year old kid in the classroom sitting with his
> father, and asking most of the questions! One of those who even in
> middle school knew how to program well and had a talent for it.

eh? Not long ago you insisted over and over, directly to me, that good
programming skills doesn't require talent.

You've been sucking up to Feeb too much.


DFS

unread,
Feb 3, 2024, 11:40:31 PMFeb 3
to
On 1/31/2024 6:33 PM, Physfitfreak wrote:


> "Each integer is made of three non-repeating digits and when you
> divide the integers by the products of their own digits they give
> exactly the month and the day of birthday of Holaku's beautiful
> daughter, respectively! :)"
> ...
> Tusi right away gave him two other three-digit numbers that had
> exactly the same properties!
>
> What was the date of Holaku's daughter's birthday?


> can you show a computer program to do solve the proposed problem?

Of course.

===================================================================
nbr,prod,div = 0,0,0.0
daymth = [0] * 31

for i in range(1,10):
for j in range(1,10):
for k in range(1,10):
if (j!=i and k!=i and k!=j):
nbr = int(str(i) + str(j) + str(k))
prod = i * j * k;
div = nbr / prod
if nbr % prod == 0:
if div >= 1 and div <= 31:
daymth[int(div)-1] += 1

for i in range(1,32):
if daymth[i-1] > 1:
if i > 12:
print("Birth day = %d" % (i))
else:
print("Birth month = %d" % (i))
===================================================================

$python age.py
Birth month = 8
Birth day = 18



Notice Feeb refused to show his code. That's not an oversight - he's
afraid for others to see it.


Physfitfreak

unread,
Feb 3, 2024, 11:46:30 PMFeb 3
to
So Farley has enthusiasm. What's wrong with that? In a usenet setting it
is great to have enthusiasm.

Talk is cheap, he solved some of the problems I posed, and you and
others didn't. That's what matters. He also proposed some problems and
none of you could answer. That counts a lot. He's alive, you guys are
half dead. Some among you are stone dead! Totally dysfunctional.

Your answer to this latest problem is plain wrong. This far, you're not
even a code monkey. Sorry.

Do you have a music background?




Physfitfreak

unread,
Feb 3, 2024, 11:49:20 PMFeb 3
to
Don't let Farley see this answer of yours :) You'll get a bad day.

DFS

unread,
Feb 4, 2024, 12:54:36 AMFeb 4
to
On 2/3/2024 11:46 PM, Physfitfreak wrote:
> On 2/3/2024 6:58 PM, DFS wrote:
>> On 2/3/2024 5:17 PM, SandChimp wrote:
>>
>>> It amounts to being on the left side of the intelligence curve, where
>>> half of the Americans happily reside. RIP Carlin... I hear you.
>>
>> Can you imagine what the intelligence curve of you 97-IQ Iranian
>> chimps looks like?

Bunch of hairy, smooth-brained imbeciles committing honor killings and
sponsoring terrorism wherever they can.
Well?
I don't know why you're smitten with the lying, hostile wackjob.



>>> There was also a 13 or so year old kid in the classroom sitting with
>>> his father, and asking most of the questions! One of those who even
>>> in middle school knew how to program well and had a talent for it.
>>
>> eh?  Not long ago you insisted over and over, directly to me, that
>> good programming skills doesn't require talent.
>>
>> You've been sucking up to Feeb too much.
>>
>>
>
>
> So Farley has enthusiasm. What's wrong with that? In a usenet setting it
> is great to have enthusiasm.

You're mistaking mental illness and extreme insecurity for enthusiasm.


> Talk is cheap,

Yes it is, and Feeb's talk is the cheapest on cola.


> he solved some of the problems I posed, and you and
> others didn't.

I've had you killfiled for months.


> That's what matters. He also proposed some problems and
> none of you could answer. That counts a lot. He's alive, you guys are
> half dead. Some among you are stone dead! Totally dysfunctional.

The group is comp.os.linux.advocacy, not comp.solve.math.problems. I
like to write small programs in C and python, so some of these problems
appeal to me (if I happen to see them).


> Your answer to this latest problem is plain wrong. This far, you're not
> even a code monkey. Sorry.

Doubling down on your idiocy? My last answer is 100% correct, and it is
"completely invalid PhysFit problem that cannot be answered". Probably
it's your English, and that bogus story. You were much more concerned
with the homoerotic fantasy and the gold coins than formulating a valid
problem.

With random pieces and random placement of the pieces, you can never
know beforehand how many possible moves will be available.


> Do you have a music background?

No, but I sense you play the skin flute.


DFS

unread,
Feb 4, 2024, 1:20:23 AMFeb 4
to
On 2/3/2024 5:17 PM, Physfitfreak wrote:
> On 2/3/2024 10:19 AM, Farley Flud wrote:
>> On Sat, 3 Feb 2024 04:00:30 -0600, Physfitfreak wrote:
>>
>>>
>>> Thus the story continues...
>>>
>>> How many gold coins should Holaku Khan take with him to his parties?
>>>
>>
>> I'll pass.  I don't know how to play chess.  I think that, like all
>> games, chess is stupid and boring.

It's actually thrilling and challenging. It's a real downer to lose,
though.

The former cola "advocate" Branimir Maksimovic is a chess International
Master.


>> It reminds of the time I enrolled in a computer science class at
>> the university.  Our very first assignment was to write a program
>> that kept score of a bowling game.
>>
>> Bowling?  I don't fucking know how to bowl.  I never fucking went
>> bowing in my entire fucking life.
>>
>> So now I first gotta learn the rules of the game of bowling and
>> then write the program.  I said: "Fuck that!"  I just dropped the
>> course.  I'll enroll with an instructor who is progressive and sane.
>>
>
>
> Hahhahah :) Makes sense.


It makes sense to you to drop a class rather than spend 10 minutes
learning how bowling scores are calculated? It was Feeb chickening out
and running away.



> I used the chess game in this story cause it is a much, much more
> universal pastime, and very ancient. So ancient that terms associated
> with it in German and Persian are almost the same! It goes that far back.
>
> And I used only the movement types of its pieces, and nothing else. No
> other rules whatsoever.

Incorrect. You also stipulated random pieces placed randomly on the
board, making your problem invalid.



> And I assumed everybody knows that chessboard is
> an 8 squares by 8 squares board, consisting of 64 squares on which these
> pieces can move in their own ways if not blocked by another piece.
>
> This story gives an opportunity - for the code monkeys really - to try
> their use of loops within loops to solve clear but involved logical
> situations. Several arrays are involved.

You can throw a million "real programmers" at it - as you worded it, the
problem is unsolvable.


> I intended to later add one more piece to the two! :-) And then one
> more, and then one more... Then one would get very close to do what
> computer chess developers do.

Chess game developers start with known pieces at known starting
positions. Your weird problem started with random pieces at random
positions.


> But if it has to stop in this forum, before even it started, then so be it.

?



> But I still challenge everybody in this forum other than Farley, to
> salvage their fucked up images as "programmers", by writing the baby
> program that solves this problem in its most simple form, which is two
> chess pieces.

Which two? Where are they positioned? Can one piece block the other?


> It is simple enough to be done by any code monkey, and yet
> involved enough to be too time-consuming to do it "by hand".

When is your "solution" coming?


Physfitfreak

unread,
Feb 4, 2024, 1:33:48 AMFeb 4
to
I don't know Python. Write the code in BASIC so I can verify it. And do
not use AI to write the code for you.


Physfitfreak

unread,
Feb 4, 2024, 2:29:12 AMFeb 4
to
But looks like you've got the gist of it correctly. So never mind.

The fastest way to get to the result is not to code everything, but just
find cases of three digit integers with non-repeating digits, that when
divided by the product of their three digits would result another
integer lower than 32 (i.e. day of the month is within 1 to 31, and
month of the year is within 1 to 12). Then by looking at the output we
can detect which resulting integers were repeated and how many times.

The qbasic code for it is:

For i=1 to 9
for j = 1 to 9
if j<>i then
for k = 1 to 9
if k<>j and k<>i then
dm=(100*i + 10*j + k)/(i*j*k)
if (dm - fix(dm) < 0.00000001) and (dm > 0) and (dm < 32) then
print, i,j,k, "day or month is: ";dm
end if
end if
next k
end if
next J
next i

Which results in an output with the column list of 3 digit integers on
the left, and column for "day or month" numbers on the right. Then by
looking at day or month numbers one can see that only 8 and 18 are
repeated, and repeated twice, and one is less than 13 so the month must
be that one, and the other must then be the day of the month.

Note that since round off error in qbasic is high, instead of the "= 0"
in the if condition, I had to use "< 0.00000001" otherwise even if
correct result of division is an integer, the difference between that
number and the actual integer form of the number (fix(dm)) might not be
zero, but a very small number; in which case I would miss all such result.

So this problem was well-posed after all. The story matched the math :)



Stéphane CARPENTIER

unread,
Feb 4, 2024, 9:24:25 AMFeb 4
to
Le 03-02-2024, Farley Flud <f...@linux.rocks> a écrit :
> On Sat, 3 Feb 2024 04:00:30 -0600, Physfitfreak wrote:
>>
>> Thus the story continues...
>>
>> How many gold coins should Holaku Khan take with him to his parties?
>
> I'll pass. I don't know how to play chess.

That's easy to believe.

> I think

I don't believe that.

> So now I first gotta learn the rules of the game of bowling and
> then write the program. I said: "Fuck that!" I just dropped the
> course.

I believe you were unable to find the solution on Internet and found an
excuse to drop without confessing the request was beyond you capacities.

DFS

unread,
Feb 4, 2024, 10:37:16 AMFeb 4
to
That's OK. You don't need to know much Python at all to decipher that
little bit. It is important to know Python requires/enforces tab indenting.

* the first line declares and initializes 3 variables (2 ints and a
float). You don't have to specify datatypes in Python. Python
assigns the initial datatype based on the values you first assign to
a variable.
* the second line declares and initializes a length-31 int array
containing all zeroes.
* line 3 is blank
* lines 4,5,6 start nested loops used to build the integers (note they
don't include zeroes - I wrote a version that allowed zeroes in the
integers, and it came back with a bunch of different birthdays.
* line 7 ensures the integers have no repeating digits
* line 8 converts each digit to a string, concatenates them, then
converts that string to a 3-digit integer.
* line 9 calcs the product of the digits
* line 10 divides the 3-digit integer by the product of the digits (I
call the result 'div')
* line 11 calcs a modulo to ensure the 3-digit integer is exactly
divisible by the product of the digits. Those are the only 3-digit
integers we're concerned with.
* line 12 ensures we consider only div values between 1 and 31 (days of
the month) inclusive
* line 13 increments the values in the array declared in line 2. Python
array-addressing is 0-based.
* line 14 is blank
* line 15 starts a loop to examine the counts of div in the array.
Python range(N) by default stops at N-1.
* line 16 looks for div values appearing more than once (given your
specs, I could've said = 2)
* line 17 says values above 12 are to be considered days
* line 18 prints the birth day
* line 19 is an else
* line 20 says value up to 12 are months (this is a weakness, since they
could also be days)


> Write the code in BASIC so I can verify it.

No. But it would look very similar in C and VBA.

I HIGHLY recommend you drop all Basics and start learning Python. It
has some kickass features and builtin functions that can really save
time. It's easy to learn, write and read. It's real slow at certain
things, though.


> And do not use AI to write the code for you.

I would be stunned if AI could actually write such code, or even solve
the problem without code.


DFS

unread,
Feb 4, 2024, 11:02:10 AMFeb 4
to
On 2/4/2024 2:29 AM, Physfitfreak wrote:

>> I don't know Python. Write the code in BASIC so I can verify it. And
>> do not use AI to write the code for you.
>>
>
> But looks like you've got the gist of it correctly. So never mind.
>
> The fastest way to get to the result is not to code everything, but just
> find cases of three digit integers with non-repeating digits, that when
> divided by the product of their three digits would result another
> integer lower than 32 (i.e. day of the month is within 1 to 31, and
> month of the year is within 1 to 12). Then by looking at the output we
> can detect which resulting integers were repeated and how many times.

No sense in writing partial code - a few more lines and the computer
does everything for you.



> The qbasic code for it is:
>
> For i=1 to 9
>   for j = 1 to 9
>     if j<>i then
>       for k = 1 to 9
>         if k<>j and k<>i then
>           dm=(100*i + 10*j + k)/(i*j*k)
>           if (dm - fix(dm) < 0.00000001) and (dm > 0) and (dm < 32) then
>             print, i,j,k, "day or month is: ";dm
>           end if
>         end if
>       next k
>     end if
>   next J
> next i
>
> Which results in an output with the column list of 3 digit integers on
> the left, and column for "day or month" numbers on the right. Then by
> looking at day or month numbers one can see that only 8 and 18 are
> repeated, and repeated twice, and one is less than 13 so the month must
> be that one, and the other must then be the day of the month.

The computer can suss that better and faster than us.

So do yourself a favor and finish the QBasic code so it identifies the
birthday for you.



> Note that since round off error in qbasic is high, instead of the "= 0"
> in the if condition, I had to use "< 0.00000001" otherwise even if
> correct result of division is an integer, the difference between that
> number and the actual integer form of the number (fix(dm)) might not be
> zero, but a very small number; in which case I would miss all such result.
>
> So this problem was well-posed after all. The story matched the math :)

Is it a Persian thing to dress up simple math problems with long, weird,
elaborate stories, replete with magic mountains and plush carpets and
virginal daughters and princes carrying bags of gold coins?

Or are you high when you post such nutty problems?

DFS

unread,
Feb 4, 2024, 1:10:24 PMFeb 4
to
===================================================================
C version
===================================================================
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void) {

int i,j,k,nbr,prod;
char nbrstr[4];
double div;
int daymth[31] = {0};

for (i = 1; i < 10; i++) {
for (j = 1; j < 10; j++) {
for (k = 1; k < 10; k++) {
if (j!=i && k!=i && k!=j) {
sprintf(nbrstr,"%d%d%d", i,j,k);
nbr = atoi(nbrstr);
prod = i*j*k;
div = (double)nbr / (double)prod;
if (nbr % prod == 0) {
if (div >= 1 && div <= 31) {
//printf("Nbr=%d, Product=%d, Div=%.f\n",nbr,prod,div);
daymth[(int)(div)-1] += 1;
}
}
}
}
}
}

for (i=1;i<=31;i++) {
//printf("%d\n", daymth[i-1]);
if (daymth[i-1] > 1) {
if (i > 12)
{printf("Birth day = %d\n", i);}
else
{printf("Birth month = %d\n", i);}
}
}

return(0);
}
===================================================================
$ ./age
Birth month = 8
Birth day = 18





===================================================================
VBA version (runs unchanged in Access 2003 and Excel 2003)
===================================================================
Dim i, j, k, nbr, prod As Integer, div As Single
Dim daymth(31) As Integer

For i = 0 To 30
daymth(i) = 0
Next

For i = 1 To 9
For j = 1 To 9
For k = 1 To 9
If j <> i And k <> i And k <> j Then
nbr = CInt(CStr(i) & CStr(j) & CStr(k))
prod = i * j * k
div = nbr / prod
If nbr Mod prod = 0 Then
If div >= 1 And div <= 31 Then
daymth(CInt(div) - 1) = daymth(CInt(div) - 1) + 1
End If
End If
End If
Next
Next
Next

For i = 1 To 31
If daymth(i - 1) > 1 Then
If i > 12 Then
Debug.Print "Birth day = " & i
Else
Debug.Print "Birth month = " & i
End If
End If
Next
===================================================================
output in immediate window

Physfitfreak

unread,
Feb 4, 2024, 2:30:39 PMFeb 4
to
On 2/4/2024 1:29 AM, Physfitfreak wrote:
> So this problem was well-posed after all. The story matched the math :)


"Well-posed" in the sense that if, for instance, there were more than
two repeating numbers in the list of "day or month" column, say, two
occurrences of 11's as well, then one could know neither the day nor the
month of her birthday. So I'm glad the result showed otherwise :)

Well, back then, I don't know how many decades ago, I had made sure this
was not the case anyway. But I don't remember how I knew it. I could've
solved it myself back then, or the math discussion of that feature about
3 digit integers itself proved it, in wherever article it was that I was
reading; by all probability one in a Scientific American magazine.


Physfitfreak

unread,
Feb 4, 2024, 2:39:47 PMFeb 4
to
Highly suspect to be the product of a simple AI request.

You can't prove your status of "code monkey" to me by posting codes in
any language. You prove _not_ to have that status by totally getting
confused about my chess problem that I proposed.

That's where you show yourself, not in the codes that you may have
copied and pasted.


rbowman

unread,
Feb 4, 2024, 3:16:46 PMFeb 4
to
On Sun, 4 Feb 2024 13:39:43 -0600, Physfitfreak wrote:

> You can't prove your status of "code monkey" to me by posting codes in
> any language. You prove _not_ to have that status by totally getting
> confused about my chess problem that I proposed.

In my FORTRAN IV class in 1965 we did a few chess problems. someone was
going to write a complete chess program real soon any day now. Hubris is a
wonderful thing.

DFS

unread,
Feb 4, 2024, 4:02:59 PMFeb 4
to
'suspect' only in the mind of a weird sand chimp who's embarrassed he
can't write such simple programs, even after decades of coding experience.

But go ahead and show me the AI program that generates such code, bozo.
I'll be waiting.


> You can't prove your status of "code monkey" to me by posting codes in
> any language.

I was curious how the same program looked, side by side, so I knocked
out the C and VBA versions this morning, in no time. Python is the
shortest and tidiest, as it usually is.

I notice "code monkey" is used only by the worst programmers on cola:
Feeb and you.



> You prove _not_ to have that status by totally getting
> confused about my chess problem that I proposed.

I still don't know what you were asking. I suspect you don't, either.
And you still haven't offered any solutions.

Next time pass it by a native English speaker before posting. And drop
all the fancy, irrelevant stories. It's math or logic, not bedtime
fantasies.


> That's where you show yourself, not in the codes that you may have
> copied and pasted.

Study and learn from them. You won't find them anywhere on the planet
but right here on cola. But feel free to spend days looking.


Physfitfreak

unread,
Feb 4, 2024, 8:53:22 PMFeb 4
to
On 2/3/2024 4:00 AM, Physfitfreak wrote:
> "In each of my parties, a session is always included in which a
> chessboard is placed on the floor, with no chess pieces on it. There is
> a contest, and the winner is blindfolded and given two random chess
> pieces of same color - but not any pawns - out of my pocket, to place
> somewhere on the chessboard by the winner, in two of the squares. Then
> the blindfold is removed and the winner will look at the chessboard and
> counts the number of different moves he can make with the chess pieces
> from the squares that they are in. The winner will get as many gold
> coins from me as that count is. If I know in advance which two pieces
> will be given to the winner, I need to know how many gold coins I should
> bring with me to the party, so I could never find myself with not enough
> coins to give to the winner, and never carry with me even one gold coin
> that would never be needed to be given to the winner. Find how many
> coins I should bring with me to the party."


Looks like for the sub-"code monkeys" a bit of more explanation is due.

Holaku will give one gold coin for every different first move that the
winner can make on the board.

Example. If the two pieces happen to be two bishops, and if the
blindfolded winner happened to place one at the first square on the left
of the bottom row, and the other on the last square on the far right of
the bottom row, then winner will get 14 gold coins.


DFS

unread,
Feb 4, 2024, 10:20:05 PMFeb 4
to
Ho Lee Fuk!

Are you now saying the challenge is to determine the max squares 2
random chess pieces can possibly cover with one move each, from any
random starting position? Is that it? Is that clear to you?

The original problem said "count the number of different moves he can
make". No mention of how many squares the move could cover. A rook in
the bottom right corner can make 2 moves (left and forward), but a rook
in the middle of the board can make 4 moves (left right forward backward).

Back to your example: What if one bishop is moved 1 square, and the
other is moved 3 squares? Those are valid moves, worth 4 gold coins.
In your scenario, does that count? Or does the move have to cover the
max squares available, given the starting position?

Also: a bishop in one corner and a queen in the far corner (both on the
same diagonal). If the queen moves first - off the diagonal - the
bishop can then cover 7 squares max. But if the bishop moves first,
he's blocked by the queen and can cover a max of only 6 squares. How is
such blocking to be addressed? Should the code solution maximize the
total squares by moving the blocking piece first?


Also:

* "the winner is blindfolded and given two random chess pieces
of same color"

* "If I know in advance which two pieces will be given to the winner"

If he's given random pieces, you can't know in advances which pieces
will be given. These contradictions make the setup even more confusing.


I told you you didn't even know what you were asking.

But if I'm finally grasping the challenge as I restated it, it's very
interesting and probably doable without too much trouble. Being
optimistic. So my plan would be to conceive of the board as a 2-d array
with locations (0,0) to (7,7), pick 2 random pieces, place them randomly
on the board, and try to maximize the available squares for each piece
to move, considering the starting position and behavior of each piece.
And the aforementioned blocking is an issue that has to be considered.

I'm getting a little ahead of myself.

Where's the original problem? Point us to that, so nothing gets lost in
chimp-babble translation.


Physfitfreak

unread,
Feb 5, 2024, 12:57:09 AMFeb 5
to
You're really stupid. And not even a code monkey. A cro-magnon. It's
occasions like this that points to your species itself.


Physfitfreak

unread,
Feb 5, 2024, 2:51:53 AMFeb 5
to
On 2/3/2024 4:00 AM, Physfitfreak wrote:
> Ghotbeddin:
>
>    "Your Majesty's wish will undoubtedly get fulfilled."
>
>


The rest of the story:

Ghotbeddin forgot that a daughter of Holaku even exists, and immediately
went home to work on the problem. Got his chessboard and placed it down
on the floor, on top of the fine Persian carpet woven in that same area,
according to Azarbayjan's styles which both colorwise and patterns were
distinct in Iran. He placed two same color pieces on the board and began
thinking...

Worked on it all night. By morning, his hopes of giving the tabulated
answers to Holaku on that morning had disappeared into thin air. It
would take some time to finish this job! So he went to bed tired and
beaten, and soon fell asleep. But shortly after he felt unusually cold.
Opened his eyes and found himself in his sleeping bag at the top of the
magic mountain!

Still remembering the dream, he stretched his hand into his backpack and
pulled out his Aspire One mini laptop dedicated to DOS, with qbasic on
it, prepared hot water to make tea, and as he gave out a good voluminous
fart he loudly said, "To you Pope The Penis X!" Then began coding the
now simple and totally under control problem. He got the answers,
tabulated them nicely, then hoped he would travel back to 13th century
next time he went to sleep, to give the table to Holaku Khan, and see
the beautiful daughter.






Lord Master

unread,
Feb 5, 2024, 7:06:38 AMFeb 5
to
On Sunday, February 4, 2024 at 1:10:24 PM UTC-5, DFS wrote:

> sprintf(nbrstr,"%d%d%d", i,j,k);
> nbr = atoi(nbrstr);
>

Oh my fucking god! The incompetent code monkey strikes again!

Look at this piece of shit. The dumbfuck converts integers to a string and
then converts the string back into an integer! This is the pinnacle of
programming idiocy!

Just do:

int num = 100*i + 10*j + k;

>
> prod = i*j*k;
> div = (double)nbr / (double)prod;
> if (nbr % prod == 0) {
> if (div >= 1 && div <= 31) {
>

Then the retard casts integers to doubles (!!!) to perform divison!!!

A competent programmer just performs integer division directly:

div_t q = div(num, i*j*k);
if(q.rem == 0) { ... }

Get this supreme idiot out of here!

A "code monkey" is too good of a term for this infinite retard.

DFS

unread,
Feb 5, 2024, 10:36:42 AMFeb 5
to
On 2/5/2024 7:06 AM, Lameass Larry Piet Master wrote:


> A "code monkey" is too good of a term for this infinite retard.


Feeb: I used a small C program to "brute force" the solution.

DFS : Where's your original code?

Feeb: Give me a minute. Mine was shit, so I'm busy copying ideas from
yours.



And that is a FACT. And that's why you'll NEVER post your original code.

Physfitfreak

unread,
Feb 5, 2024, 6:23:03 PMFeb 5
to
On 2/5/2024 6:06 AM, Lord Master wrote:
> A "code monkey" is too good of a term for this infinite retard.


Ditto.

A code monkey at least understands what the chessboard problem is
asking. And can carefully proceed to code it. He isn't there yet. It
gets him confused.



DFS

unread,
Feb 5, 2024, 6:29:56 PMFeb 5
to
On 2/5/2024 12:57 AM, Physfitfreak wrote:

> You're really stupid. And not even a code monkey. A cro-magnon. It's
> occasions like this that points to your species itself.

Here chimpy chimpy! Got a treat for you.


=======================================================================
//this progam determines the max number of squares 2 random non-pawn
chess pieces can
//possibly cover with one move each, from any random starting position.
Code assumes
//one piece cannot block the other.

//This code is hereby donated to the public domain

//usage:
//$ ./prog <leave blank and system will generate 2 random pieces>
// or
//$ ./prog <piece1> <piece2> no brackets
//$ ./prog Qe6 Ka1

//pieces and starting position must be entered using standard
// chess algebraic notation: Ba3 Kg1 Ne8 etc
//pieces : K king, Q queen, R rook, B bishop, N knight
//columns: abcdefgh
//rows : 1-8


#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>


//K king, Q queen, R rook, B bishop, N knight
char *pieces[] = {"K","Q","R","B","N"};
char *pieceslong[] = {"King","Queen","Rook","Bishop","Knight"};

//build random piece and starting position
//column,row is converted to algebraic notation
char *genpiece(char newpiece[]) {
char piece[2], col[2];
sprintf(piece,"%s",pieces[rand() % 5]);
sprintf(col,"%c",(rand() % 8) + 97);
int row = (rand() % 8) + 1;
sprintf(newpiece,"%s%s%d",piece,col,row);
}

//find largest value
int getmax(int a, int b, int c, int d) {
int max = 0;
if (a > max) {max = a;}
if (b > max) {max = b;}
if (c > max) {max = c;}
if (d > max) {max = d;}
return max;
}

//find smallest value
int getmin(int a, int b, int c, int d) {
int min = 9;
if (a < min) {min = a;}
if (b < min) {min = b;}
if (c < min) {min = c;}
if (d < min) {min = d;}
return min;
}


// determine max number of squares that can be moved from the starting
position
int calcsquares(char piece[], char endpos[]) {

//min and max square moves by piece
//king 1,1
//queen 1,7
//rook 1,7
//bishop 1,7
//knight 3,3

int squares = 0;

//convert algebraic notation to col,row
//a1 = col 1,row 1 white, bottom left
//h8 = col 8,row 8 black, top right
int pcol = piece[1]-96;
int prow = atoi(&piece[2]);

//kings and knights will always be able to move 1 and 3 squares
//respectively, no matter the starting position
if (piece[0] == 'K') { squares += 1; }
if (piece[0] == 'N') { squares += 3; }

//left and right edges of board are 1 and 8
//bottom and top of board are 1 and 8

//rooks move on rows or columns
//queens move anywhere, but diagonal moves can never exceed the
// number of spaces available on rows and columns
//evaluate 4 move directions: left, right, forward, backward
int l=0,r=0,f=0,b=0;
if (piece[0] == 'R' || piece[0] == 'Q') {
l = pcol - 1;
r = 8 - pcol;
f = 8 - prow;
b = prow - 1;
squares += getmax(l,r,f,b);
//printf("%s: left %d, right %d, fwd %d, bwd %d
max=%d\n",piece,l,r,f,b,getmax(l,r,f,b));
}

//bishops move on diagonals (down left, down right, up left, up
right)
//https://www.geeksforgeeks.org/count-the-total-number-of-squares-that-can-be-visited-by-bishop-in-one-move/
//99 and -99 are used just to send 4 args to the functions
int dl=0, dr=0, ul=0, ur=0;
if (piece[0] == 'B') {
dl = 8 - getmax(prow, 9-pcol, -99, -99);
dr = getmin(prow, 9-pcol, 99, 99) -1;
ul = getmin(prow, pcol, 99, 99) - 1;
ur = 8 - getmax(prow, pcol, -99, -99);
squares += getmax(dl,dr,ul,ur);
//printf("%s: down left %d, down right %d, up left %d, up right %d
max=%d\n",piece,dl,dr,ul,ur,getmax(dl,dr,ul,ur));
}


return squares;

}


int main(int argc, char *argv[]) {

//TODO maybe:
// 1. handle piece blocking
// 2. allow 3+ pieces using an array
// 3. capture and display ending position

//random
srand(time(NULL));

//pieces
char p1[4], p2[4];

//no input from user, so system generates 2 random pieces
if (argc == 1)
{ genpiece(p1);
genpiece(p2);
while (strcmp(p1,p2)==0) { genpiece(p2); } //ensure 2 different
pieces
}

//invalid entry
if ((argc == 2) || (argc > 3))
{ printf("Enter 2 valid pieces\n");
exit(0);
}

//user inputs
if (argc == 3)
{ sprintf(p1,"%s",argv[1]);
sprintf(p2,"%s",argv[2]);
if (strcmp(p1,p2)==0)
{ printf("You entered 2 of the same piece \n");
exit(0);
}
}

//pieces and algebraic notation must be len(3)
if (strlen(p1)!=3 || strlen(p2)!=3)
{ printf("Enter 2 valid pieces\n");
exit(0);
}


//calc max squares moved per piece
int p1squares = calcsquares(p1);
int p2squares = calcsquares(p2);


//summary of squares moved
printf("\n");
printf(" Max\n");
printf("Start Squares\n");
printf("---------------\n");
printf("%-5s %d\n", p1,p1squares);
printf("%-5s %d\n", p2,p2squares);
printf("---------------\n");
printf("Total %d\n", p1squares + p2squares);
printf("---------------\n\n");

return(0);
}
====================================================================

Not well-tested. Free banana and back-shave if you find a calculation
bug. It will allow some bad input, so watch your paws.

All code freshly written except bishop/diagonal formulas from website.

DFS

unread,
Feb 5, 2024, 6:37:21 PMFeb 5
to
On 2/5/2024 6:29 PM, DFS wrote:
> On 2/5/2024 12:57 AM, Physfitfreak wrote:
>
>> You're really stupid. And not even a code monkey. A cro-magnon. It's
>> occasions like this that points to your species itself.
>
> Here chimpy chimpy!  Got a treat for you.

bug!

replace line 62
int calcsquares(char piece[], char endpos[]) {

with
int calcsquares(char piece[]) {


Physfitfreak

unread,
Feb 5, 2024, 7:38:34 PMFeb 5
to
On 2/5/2024 5:29 PM, DFS wrote:
> //$ ./prog <leave blank and system will generate 2 random pieces>


You have not understood the problem.

Physfitfreak

unread,
Feb 5, 2024, 7:41:50 PMFeb 5
to
I don't think you have understood the problem.

If you think you have, then in your own words state the problem.

Physfitfreak

unread,
Feb 5, 2024, 8:40:01 PMFeb 5
to
So the story continues...

Days came and passed. None of the night sleeps resulted in a dream to
take him to the 13th century with the now ready table. So at night, when
warming himself with a little fire and getting ready to go to his
sleeping bag, he thought to himself, "If I don't travel back to Maragheh
observatory tonight, I'll just burn the one page table in the fire and
forget about it."

The night became morning, and Physfit still in his sleeping bag openned
his eyes and realized something was not right. There were clouds above
him! "At this altitude?..." he asked himself. He turned his head left
and found he was looking at urban areas of Dallas, with the Reunion
Tower over there standing by downtown! Turned his head right and saw
that he was lying down in his sleeping bag at the top of a 100 yard
mountain, with his house in the view, within a short walking distance!
He quickly, before anything get changed again, got up and put on his
mountain shoes and dress, and got ready to climb down fast before the
mountain gets bigger again.

By the time he reached the ground level, it was 4:45 pm and the sun was
setting, and in another 15 minutes he was home, at his computer, going
through the news.

He read somewhere that at least half of the Americans' missiles to hit
Houthi targets would only hit the adjacent areas, not the targets
themselves, but each time Houthis lauched a missile, it came down dead
correct and hit the target. Physfit wondered about it for a few moments.

There were a few related news pieces as well. In one of them, from a
Pakestani press outlet, they explained in detail how the missiles
automatically calculated the coordinates of the target. A reconnaissance
drone beforehand would get near enough to target to see it, then using
laser would fly on a straightline towards the target and record its own
coordinates at two different points on that straight line.

Then using such information, back home, the distance of the target to
the missiles launching site would accurately get calculated. Then they'd
launch the missiles.

Everything calculated were in two dimensions only. Just height and the
distance.

If the drone calculated coordinates of the two points on that line of
sight as (x_1, y_1) and (x_2, y_2), with x being the distance and y the
height, then the distance of the target to launch area would have any of
the two forms below:

x . y - x . y
1 2 2 1
x = -----------------
y - y
2 1

or:


/x - x \ . y
\ 2 1/ 1
x = x - --------------
1 y - y
2 1


And the Americans in charge being cro-magnons (and Nazi), seeing that
one of the above formulas can be derived from the other one, were
assuming it didn't matter which one to use for calculating x-intercept
for their missiles to hit Houthis targets. But Houthis, being Modern
Humans, always chose one of the above, and never the other.

So Physfit found out why about half of American missiles narrowly miss
their targets, while Houthis missiles always hit the targets.

1- Verify that the two formulas are correct, and algebraically related.

2- Assuming the drone calculated (x_1, y_1) as (1.31, 4.76) kilometers,
and (x_2, y_2) as (1.93, 3.24) kilometers, and assuming that for
shortest computation time, numbers are rounded to three digits in the
codes imbedded in drones and missiles, then calculate the x-intercept in
both ways.

3- Explain which of the two methods is being used by the Houthis, and why.



DFS

unread,
Feb 5, 2024, 9:12:08 PMFeb 5
to
The very first comment line explains what the code does:

"this progam determines the max number of squares 2 random non-pawn
chess pieces can possibly cover with one move each, from any random
starting position. Code assumes one piece cannot block the other."


Which is based on what your example says it should do:

"Example. If the two pieces happen to be two bishops, and if the
blindfolded winner happened to place one at the first square on the left
of the bottom row, and the other on the last square on the far right of
the bottom row, then winner will get 14 gold coins."


Try it:

$ ./program Ba1 Bh1

Max
Start Squares
---------------
Ba1 7
Bh1 7
---------------
Total 14
---------------



* you have to enter the pieces using standard chess algebraic notation.

* if you don't enter anything, the program generates 2 random pieces.

Either way, it calculates the max squares each piece can move one time
(assuming no blocking).




Physfitfreak

unread,
Feb 5, 2024, 9:29:49 PMFeb 5
to
No.

You must understand the problem first. Any code monkey has good reading
comprehension, otherwise they're just useless cause they won't know what
it is that the employer wants them to do.


DFS

unread,
Feb 6, 2024, 12:06:27 AMFeb 6
to
On 2/5/2024 9:29 PM, Physfitfreak wrote:


> No.
>
> You must understand the problem first. Any code monkey has good reading
> comprehension, otherwise they're just useless cause they won't know what
> it is that the employer wants them to do.


I think this is what you're looking for.

For any non-pawn piece, starting at any position on the board, it shows
2 values:
* the longest single move available
* the sum of all the squares covered by all available moves

This board is helpful to look at when trying the program:
https://en.wikipedia.org/wiki/Algebraic_notation_(chess)#/media/File:SCD_algebraic_notation.svg

You know how to compile and run it, right?


======================================================================

//This program determines the max number of squares 2 random non-pawn
chess pieces can
//possibly cover with one move each, and with all available moves, from
any random
//starting position on the board.
//Code assumes one piece cannot block the other.
int calcsquares(char piece[], char *cntmoves) {

//cntmoves flag:
// 'one' means piece can make only 1 move - find max squares covered
// 'all' means piece can make all possible moves - sum them all

//min and max square moves by piece
//king 1,1
//queen 1,7
//rook 1,7
//bishop 1,7
//knight 3,3

int squares = 0;


//convert algebraic notation to col,row
//a1 = col 1,row 1 white, bottom left
//h8 = col 8,row 8 black, top right
int pcol = piece[1]-96;
int prow = atoi(&piece[2]);

//left and right edges of board are 1 and 8
//bottom and top of board are 1 and 8


//kings and knights will always be able to make at least one move of
//1 and 3 squares respectively, no matter the starting position
if (cntmoves == "one")
{
if (piece[0] == 'K') { squares += 1; }
if (piece[0] == 'N') { squares += 3; }
}

if (cntmoves == "all")
{
//king
if (piece[0] == 'K')
{
//positioned in a corner (3 moves of 1 square each)
if (pcol==1 && prow==1) {squares += 3;}
if (pcol==1 && prow==8) {squares += 3;}
if (pcol==8 && prow==1) {squares += 3;}
if (pcol==8 && prow==8) {squares += 3;}

//positioned along an edge but not in a corner (5 moves of 1
square each)
if (pcol==1 && prow>1 && prow<8) {squares += 5;}
if (pcol==8 && prow>1 && prow<8) {squares += 5;}
if (prow==1 && pcol>1 && pcol<8) {squares += 5;}
if (prow==8 && pcol>1 && pcol<8) {squares += 5;}

//positioned at least one square inside all edges (8 moves of 1
square each)
if (pcol>1 && prow>1 && pcol<8 && prow<8) {squares += 8;}
}


//knight
if (piece[0] == 'N')
{
//positioned in a corner (2 moves of 3 squares each)
if (pcol==1 && prow==1) {squares += 6;}
if (pcol==1 && prow==8) {squares += 6;}
if (pcol==8 && prow==1) {squares += 6;}
if (pcol==8 && prow==8) {squares += 6;}

//positioned along an edge but not in a corner (3 moves of 3
squares each)
if (pcol==1 && prow>1 && prow<8) {squares += 9;}
if (pcol==8 && prow>1 && prow<8) {squares += 9;}
if (prow==1 && pcol>1 && pcol<8) {squares += 9;}
if (prow==8 && pcol>1 && pcol<8) {squares += 9;}

//positioned one square in from a corner (4 moves of 3 squares
each)
if (pcol==2 && prow==2) {squares += 12;}
if (pcol==2 && prow==7) {squares += 12;}
if (pcol==7 && prow==2) {squares += 12;}
if (pcol==7 && prow==7) {squares += 12;}

//positioned one square in from an edge, rows 3-6 or cols 3-6
//(6 moves of 3 squares each)
if (pcol==2 && prow>2 && prow<7) {squares += 18;}
if (pcol==7 && prow>2 && prow<7) {squares += 18;}
if (prow==2 && pcol>2 && pcol<7) {squares += 18;}
if (prow==7 && pcol>2 && pcol<7) {squares += 18;}

//positioned at least two squares inside all edges (8 moves of 3
squares each)
if (pcol>2 && prow>2 && pcol<7 && prow<7) {squares += 24;}
}
}


//rooks and queens move on rows or columns (left, right, forward,
backward)
int l=0,r=0,f=0,b=0;
if (piece[0] == 'R' || piece[0] == 'Q')
{
l = pcol - 1;
r = 8 - pcol;
f = 8 - prow;
b = prow - 1;

if (cntmoves == "one")
{ squares += getmax(l,r,f,b); }

if (cntmoves == "all")
{ squares += (l + r + f + b); }

//printf("%s: left %d, right %d, fwd %d, bwd %d
max=%d\n",piece,l,r,f,b,getmax(l,r,f,b));
}

//bishops and queens move on diagonals (down left, down right, up
left, up right)
//but don't use the diagonal moves when searching for the Queen's
longest single move - //that's accounted for in the previous section
(left,right,forward,backward)

//https://www.geeksforgeeks.org/count-the-total-number-of-squares-that-can-be-visited-by-bishop-in-one-move/
//hack: 99 and -99 are used just to send 4 args to the min/max functions
int dl=0, dr=0, ul=0, ur=0;
if (piece[0] == 'B' || piece[0] == 'Q')
{
dl = 8 - getmax(prow, 9-pcol, -99, -99);
dr = getmin(prow, 9-pcol, 99, 99) -1;
ul = getmin(prow, pcol, 99, 99) - 1;
ur = 8 - getmax(prow, pcol, -99, -99);

if (cntmoves == "one" && piece[0] == 'B')
{ squares += getmax(dl,dr,ul,ur); }

if (cntmoves == "all")
{ squares += (dl + dr + ul + ur); }
int p1one = calcsquares(p1,"one");
int p1all = calcsquares(p1,"all");
int p2one = calcsquares(p2,"one");
int p2all = calcsquares(p2,"all");


//summary of squares moved
printf("\n");
printf(" Max Squares\n");
printf(" -----------------------------\n");
printf("Start One Move All Possible Moves\n");
printf("--------------------------------------\n");
printf("%-5s %2d %6d\n", p1, p1one, p1all);
printf("%-5s %2d %6d\n", p2, p2one, p2all);
printf("--------------------------------------\n");
printf("Total %3d %6d\n",p1one+p2one, p1all+p2all);
printf("--------------------------------------\n\n");

return(0);
}

======================================================================

DFS

unread,
Feb 6, 2024, 9:15:56 AMFeb 6
to
On 2/6/2024 12:06 AM, DFS wrote:
> On 2/5/2024 9:29 PM, Physfitfreak wrote:
>
>
>> No.
>>
>> You must understand the problem first. Any code monkey has good
>> reading comprehension, otherwise they're just useless cause they won't
>> know what it is that the employer wants them to do.
>
>
> I think this is what you're looking for.
>
> For any non-pawn piece, starting at any position on the board, it shows
> 2 values:
> * the longest single move available
> * the sum of all the squares covered by all available moves
>
> This board is helpful to look at when trying the program:
> https://en.wikipedia.org/wiki/Algebraic_notation_(chess)#/media/File:SCD_algebraic_notation.svg


You want to see real chess software?

https://stockfishchess.org
https://en.wikipedia.org/wiki/Stockfish_(chess)

It's GPL3 licensed, command line, and the strongest computer chess
engine in the world.

The C++ code is only 622KB.

vallor

unread,
Feb 6, 2024, 3:29:15 PMFeb 6
to
On Tue, 6 Feb 2024 09:15:54 -0500, DFS <nos...@dfs.com> wrote in
<sarwN.44027$9cLc....@fx02.iad>:
That's what Relf used when we had our chess game a while back.
It's not bad.

--
-v

Farley Flud

unread,
Feb 6, 2024, 4:00:36 PMFeb 6
to
1)

Multiply first term of second expression by 1 = (y2 - y1)/(y2 - y1):

x1 ⋅ (y2 - y1) (x2 - x1) ⋅ y1
────────────── - ──────────────
y2 - y1 y2 - y1


Combine fractions:

x1 ⋅ y2 - x1 ⋅ y1 - x2 ⋅ y1 + x1 ⋅ y1
─────────────────────────────────────
y2 - y1

Cancel terms:

x1 ⋅ y2 - x2 ⋅ y1
─────────────────
y2 - y1


They are equivalent.


2)

Using exact rational arithmetic based on the values given
(e.g. 1.31 = 131/100), the x-intercept for both expressions
is:

x = 3089/950 = 3.25

For an image of this, see this link:

https://postimg.cc/2LS0KRHr


3)

Because of potential catastrophic cancellation in distance coordinates,
the first expression is preferable due to the absence of subtraction
(i.e. x2 - x1) in the numerator. For the record:

x1 ⋅ y2 - x2 ⋅ y1
─────────────────
y2 - y1


Physfitfreak

unread,
Feb 6, 2024, 4:43:46 PMFeb 6
to
Hmm... But you need to show with actual numbers why in the 3rd part, one
of the expressions is better to use.

Put yourself in the shoes of a computer (inside the drones and missiles)
that rounds every number off (not just the result! But every number it
comes upon in computing the results) to keep only three significant
digits. Follow what happens from begin to end of the computation for
each expression. Then argue why one computed result is better than the
other computed result. Lot's of math lines to write, but all are needed
to see for sure why one result is better than the other.

I may have accidentally chosen the coordinate numbers that don't quite
show the difference, I don't know. I haven't solved this yet (just
concocted it last night). If that's the case, then I'll find coordinate
numbers that will show the difference.

But so far, I'm assuming just about any coordinates measured might work
to show the difference in the results of computations. So I'm asking
that you do that and show it here.








Physfitfreak

unread,
Feb 6, 2024, 7:20:03 PMFeb 6
to
I shouldn't have said, "three significant digits". Significant digit
concept is somewhat different.

Ok, let's talk more accurately.

Machine numbers are in binary form. But these machine numbers can be
expressed in decimal machine numbers like:

0.d_1d_2 ... d_k x 10^n

, where d_1 digit is _not_ zero, and d_2, d_3 ... d_k digits can each be
an integer from zero to 9.

Since this example has k digits after the decimal point, it is called
k-digit decimal machine number.

The decimal machine number form is not exactly equal to the binary form
that machine handles, and the difference has to do with the machine
epsilon. But nevertheless, the two form are very closely the same number.

In this problem, I'm assuming the computers on missiles work on such
binary numbers that have 3-digit decimal machine numbers. And forget the
binary form of them, cause this problem is not about the machine
epsilon. Just assume that the computers deal with decimal machine
numbers and k=3. So for example the number

0.0033169 x 10^4

is rounded off to

0.332 x 10^2

So depending on how your code computes the two given expressons, any
time the computer handles a number, if it is not already in 3-digit
decimal machine number form, it converts it to 3-digit machine number
before using it for computations.




Physfitfreak

unread,
Feb 6, 2024, 10:55:59 PMFeb 6
to
On 2/6/2024 3:00 PM, Farley Flud wrote:
Your reasoning is correct of course, but if you had numerically
calculated the relative errors and compared them to each other, it would
be more convincing.

The second expression, as you said, has a potential problem. If the
drone when recording its own coordinates two times, is very far from the
launch site, then x_1 and x_2 will be represented in 3-digit decimal
machine numbers by two numbers very close to each other, and their
difference when rounded produces a number with lower than 3 significant
digits. If we calculate the relative error compared to case of using
exact numbers (no rounding off), we see that it is much larger than same
relative errors for closer distances to launch site.

So, subtracting two large numbers that are very close to each other is
like asking for failure if you have it done by a machine.

But using the first expression, the closeness of the numbers x_1 and x_2
gets to a good degree ineffective because each is multiplied by the
other point's associated height _before_ subtraction is performed. So,
the difference between first and second terms in the numerator gets much
larger, causing it to lose fewer significant digits when rounded.

That's why Houthis kicked ass :-)




Physfitfreak

unread,
Feb 6, 2024, 11:06:46 PMFeb 6
to
The error in computation of second expression is bad enough when two
large and very close numbers are subtracted. In this particular case
this error is yet magnified by a factor of y_1 ... making it much larger.


DFS

unread,
Feb 7, 2024, 9:31:19 AMFeb 7
to
Were you using your wet brain?



> It's not bad.

Bit of an understatement: it's the world's strongest computer chess
engine. Totally dominant. Scroll down the wiki page and see.


Physfitfreak

unread,
Feb 7, 2024, 1:14:57 PMFeb 7
to
On 2/6/2024 8:15 AM, DFS wrote:
> You want to see real chess software?


The Radio Shack electronic chessboard I've had since 1980s still beats
me every time at level 7 and higher. It has 9 levels of play.

Who needs a better one :) You? I don't think so.




Lord Master

unread,
Feb 7, 2024, 1:36:26 PMFeb 7
to
On Tuesday, February 6, 2024 at 12:06:27 AM UTC-5, DFS wrote:
> //Code assumes one piece cannot block the other.
>
> [snip cesspool of ridiculous code]
>

The code sub-monkey does it yet again.

The entire long-winded and useless junk that he presents amounts to nothing
more than the repetative determination of known CONSTANTS. That's not what
programming is about.

In C programming, known CONSTANTS are best dealt with using LUTs, or look up tables.

For every chess piece there is a known number of moves for a given square. These
known values are entered into a 64-byte LUT, one for each piece. Then, given the piece
and location, the number of moves is quickly determined.

The VARIABLE quantity here is the location of the other piece and thus its effect on
the number of moves. This is the actual problem to be solved.

It can be solved using radii. Each piece has a number of radii on which a blocking
piece can be located. Just determine which radii for a given piece is occupied by
the blocking piece and then subtract the appropriate quantity from the LUT total.

There. I have solved the REAL PROBLEM and the REAL PROBLEM is not the determination
of the total number of possible moves.

Now just give this solution to the code monkeys and let them screech.

But not this sub-monkey. He couldn't code his way out of a paper bag -- a wet paper
bag.

Ha, ha, ha, ha, ha, ha, ha, ha!

Physfitfreak

unread,
Feb 7, 2024, 5:52:42 PMFeb 7
to
Look up table in C programming is a nice feature, but I'm for now
limited to qbasic, so I'll just use a arrays for that.

You went over only part of the problem.

The move can come from one piece or the other. So the number of all
different moves by first piece (minus what the second piece has blocked)
should be added to the number of all different moves by the second piece
as well (minus what the first piece has blocked). And this is for just
one instance of the position of first and second pieces on the board. So
the problem isn't over yet.

One needs to account for any position of the first piece on board (minus
1 to account for the occupied square by second piece) and any position
of the second piece (minus 1).

In all these situations the max number of possible moves should be
computed, so regardless of where the two pieces happen to land, and what
the two pieces happen to be, the max number be at hand, so Holaku can
bring with him that many coins, to never run short of them, and never
bring one too many.

This is an interesting coding problem :)

The solution given to Holaku will look like a 5 by 5 square table on one
page, with different chess pieces (except pawn) listed along top row and
first column. And in each square on this table, the number of coins that
Holaku should take with him is written.

So the king decides, say, to take a bishop and a knight with him, he
looks up the table and finds out how many coins he should take along.

Code this! Problem is not solved until it's coded. Then tabulate it and
show it here so I can verify your code got the numbers correct.




DFS

unread,
Feb 8, 2024, 7:21:28 AMFeb 8
to
On 2/7/2024 1:36 PM, Lying Larry wrote:

> On Tuesday, February 6, 2024 at 12:06:27 AM UTC-5, DFS wrote:
>> //Code assumes one piece cannot block the other.

> Each piece has a number of radii on which a blocking
> piece can be located. Just determine which radii for a given piece is occupied by
> the blocking piece and then subtract the appropriate quantity from the LUT total.
>
> There. I have solved the REAL PROBLEM
* YOU didn't solve anything. That was solved decades ago by
good programmers and chess players.
* YOU regurgitated some solution from a chess/programming forum.
* YOU don't know how to play chess.
* YOU are a programming failure.
* YOU are afraid to post your code, but not to criticize others'.
* YOU dropped an entire college class because YOU couldn't handle
bowling scoring (which takes all of 5 minutes to learn). So to think
YOU could write any meaningful, original chess code or provide novel
solutions to chess programming is laughable in the extreme.
* YOU cannot get YOUR lies and plagiarism and faux-expertise by me.



> and the REAL PROBLEM is not the determination
> of the total number of possible moves.

There are LOTS of "REAL PROBLEMS" in chess. Total number of possible
squares covered by all possible moves was the problem SandChimp asked
(as far as I can tell. The weirdo wrapped his problem in a story with
gold coins and clairvoyant sultans and 72 virgins and hookah smoke
wafting all around).


Lord Master

unread,
Feb 8, 2024, 7:38:34 AMFeb 8
to
On Wednesday, February 7, 2024 at 1:36:26 PM UTC-5, Lord Master wrote:
>
> For every chess piece there is a known number of moves for a given square. These
> known values are entered into a 64-byte LUT, one for each piece.
>

Oops. 'Nuther mistake.

I ferget that the chessboard has a four-fold rotational symmetry and thus
only 16 entries are necessary to populate the LUT.

Lord Master

unread,
Feb 8, 2024, 7:40:51 AMFeb 8
to
On Wednesday, February 7, 2024 at 5:52:42 PM UTC-5, Physfitfreak wrote:
>
> This is an interesting coding problem :)
>

I pass. Games always bore me and if I am bored it is impossible for my brain
to become engaged.

DFS

unread,
Feb 8, 2024, 7:42:12 AMFeb 8
to
You're asking Feeb to write a difficult program, AND show his code on cola?

Not a chance. NEVER.

He might plagiarize something then say "Did I say I wrote it?", but he
doesn't have the skills to deliver what you're asking.

You clearly don't understand what kind of phony you're dealing with.


Physfitfreak

unread,
Feb 8, 2024, 1:18:54 PMFeb 8
to
On 2/8/2024 6:42 AM, DFS wrote:
> You're asking Feeb to write a difficult program, AND show his code on cola?

I don't want to see the codes, I want to see the output tabulated in a 5
x 5 table.


Physfitfreak

unread,
Feb 8, 2024, 2:14:11 PMFeb 8
to
Nice observation.

That alone will cut down part of the computation by a factor of 4. But
there are more symmetries than just one :-) Hehe :)


Physfitfreak

unread,
Feb 8, 2024, 3:05:46 PMFeb 8
to
On 2/8/2024 6:21 AM, DFS wrote:
> There are LOTS of "REAL PROBLEMS" in chess.  Total number of possible
> squares covered by all possible moves was the problem SandChimp asked
> (as far as I can tell.  The weirdo wrapped his problem in a story with
> gold coins and clairvoyant sultans and 72 virgins and hookah smoke
> wafting all around).
>

And that's how a cro-magnon with low reading comprehension sees it.

You'd never be able to get a code monkey job. Reading comprehension in
such jobs is paramount!

As a hobby, sure, but not anything more important than that, programming
for you works.


DFS

unread,
Feb 8, 2024, 3:15:09 PMFeb 8
to
On 2/8/2024 3:05 PM, Physfitfreak wrote:
> On 2/8/2024 6:21 AM, DFS wrote:
>> There are LOTS of "REAL PROBLEMS" in chess.  Total number of possible
>> squares covered by all possible moves was the problem SandChimp asked
>> (as far as I can tell.  The weirdo wrapped his problem in a story with
>> gold coins and clairvoyant sultans and 72 virgins and hookah smoke
>> wafting all around).
>>
>
> And that's how a cro-magnon with low reading comprehension sees it.

FarsiChimp is your 1st language, and English your 2nd, correct? 'Cause
most of your problems in English are incomprehensible.
"PhysFit and the Mountain" was about 1000 words when 100 would do.

This chess thing was even more stupidly conveyed. Just ridiculous.

Next time give us a link to the original, and leave out your weird
imagination.



> You'd never be able to get a code monkey job. Reading comprehension in
> such jobs is paramount!
>
> As a hobby, sure, but not anything more important than that, programming
> for you works.

I'll smoke your doodling in ANY language.


Physfitfreak

unread,
Feb 8, 2024, 4:29:22 PMFeb 8
to
Cro-magnon's loser talk.

No I got tested on my reading comprehension and writing ability just two
months after getting here, with the GRE test, which is essentially
nothing but a tough exam for reading comprehension and writing in the
English language. And my score was high.

So don't worry about me :)

Worry about yourself. You don't fool me.


DFS

unread,
Feb 8, 2024, 7:04:06 PMFeb 8
to
On 2/8/2024 4:29 PM, Physfitfreak wrote:
> On 2/8/2024 2:15 PM, DFS wrote:
>> On 2/8/2024 3:05 PM, Physfitfreak wrote:
>>> On 2/8/2024 6:21 AM, DFS wrote:
>>>> There are LOTS of "REAL PROBLEMS" in chess.  Total number of
>>>> possible squares covered by all possible moves was the problem
>>>> SandChimp asked (as far as I can tell.  The weirdo wrapped his
>>>> problem in a story with gold coins and clairvoyant sultans and 72
>>>> virgins and hookah smoke wafting all around).
>>>>
>>>
>>> And that's how a cro-magnon with low reading comprehension sees it.
>>
>> FarsiChimp is your 1st language, and English your 2nd, correct?
>> 'Cause most of your problems in English are incomprehensible.
>> "PhysFit and the Mountain" was about 1000 words when 100 would do.
>>
>> This chess thing was even more stupidly conveyed.  Just ridiculous.
>>
>> Next time give us a link to the original, and leave out your weird
>> imagination.
>>
>>
>>
>>> You'd never be able to get a code monkey job. Reading comprehension
>>> in such jobs is paramount!
>>>
>>> As a hobby, sure, but not anything more important than that,
>>> programming for you works.

That sentence is meaningless. Like I said, your monkey babble English
is inscrutable.



>> I'll smoke your doodling in ANY language.


crickets




> Cro-magnon's loser talk.
>
> No I got tested on my reading comprehension and writing ability just two
> months after getting here, with the GRE test, which is essentially
> nothing but a tough exam for reading comprehension and writing in the
> English language. And my score was high.

So? That was a a long time ago, and chimps lose a lot of their meager
brainpower over the years.


> So don't worry about me :)
>
> Worry about yourself. You don't fool me.

Bring it, bozo. Talk's cheap.

The way to do it is this:
* you or I propose a code challenge/problem, which might be accepted or
rejected. Call us D and P
* D finishes his code solution first, but doesn't post it to cola. D
zips it up with a password and posts a link to the .zip file.
* P downloads the .zip file (but he can't open it without the password)
* P finishes his code and posts his code to cola in a message
* D posts the password to the .zip file

This way nobody can piggyback on the other's code.

Note: I will NEVER accept another code challenge like these 2 recent
ones of yours. You use 100 words when 10 will do. I won't even read
them. I'm sure they're funny to you, but it's painful to read even a
few sentences.

=======================================================================
"Physfit And The Mountain

In a sweet dream, Physfit, as he is typing away with his machine gun
fingers calling somebody in COLA "cro-magnon", and giving him the sage
advice of fingering himself, he notices through the window blinds, over
there, two blocks away from him, there is a strange mountain in an empty
field that he had never paid any attention to. In fact he had never seen
it before.

Calling it a mountain was just ridiculous of course, cause it was only
100 yards high. Physfit tells himself, "Today is my eating day, so after
eating, to relax a bit I'll climb it and sit there on top of it for a
few minutes."

So after he was done with eating the hearty soup he begins walking
towards the mountain, but as he gets closer, he realizes that its shape
is not that friendly for a quick climb, and in fact more likely he'll
need to have ropes and crampons and harnesses, and you name it to climb it.

So he walks back home and gets in the attic, brings down the dusty box
that had his old mountaineer's equipment (which he never had a use for
in Texas). Opens it up and takes what he thinks he'd need, and together
with some other supplies walks back to the mountain to get on top and
relax before coming back home.

The climb proves not easy. And this makes him even more eager to get it
done and conquer the damn strange thing.

At last, he had gone up no more than 11 yards when he notices the Sun is
already setting!... After all that effort, he thinks to himself,
"Getting back down will take too long and at best I'll make it home
several hours after my sleeping time, plus I'd have to start over
tomorrow from the ground level, making it to this height around the same
time as it is now, with no progress made after 24 hours."

So going back down would beat the purpose. He decides to camp at the
spot he is, for the night, and continue the climb next day. He gets his
sleeping bag in order and crawls inside and falls into a deep wonderful
sleep.

But during the night, as Physfit is snoring in his sleeping bag, this
strange mountain grows itself a hundred yards taller!... So Physfit's
distance to the top gets larger than before he even had begun climbing.
But fortunately, this growth didn't just add another 100 yards to the
height of the mountain, but was done proportionally, which means during
that night, Physfit's height from the ground has also increased
proportionally. So the shape of the mountain remained intact, only its
size got increased and thus added 100 more yards to the overall height.

Physfit wakes up in the morning and finds himself at the height of 22
yards on a mountain that was 200 yards high!... So in this new day, with
much effort and perseverance, he manages to climb another 11 yards up
before the Sun begins setting. And by the same logic he decides to sleep
at the spot he was and continue the climb the next day.

While asleep, the strange mountain grows itself proportionally to make
its height another 100 yards larger...

In the morning, Physfit wakes up and finds himself at the height of 49.5
yards on a mountain 300 yards tall.

While brewing his Walmart National Cup tea-bag (which amazingly after
all the recent inflation was still $1 for 100 tea-bags), he admits to
himself that conquering this summit will be harder than he expected.

Every day, from then on, he climbed another 11 yards, and every night
the mountain grew another 100 yards taller, taking him a bit higher with it.

Did Physfit reach the summit? If he reached, why he could reach it, and
how many days total it took him to get there? And if he could not reach
it, prove why he couldn't reach the summit."
=======================================================================

wtf? I never have and never will read that bullshit.


Your chess scenario was just as long, and also weird as hell (what I
read of it):

======================================================================
Thus the story continues...

The two scientists got out and locked the gate and left.

That day, in the evening, a party was to hold in Holaku's Summer
residence not that far from Maragheh. And the two were both invited!

Ghotbeddin got home and hit the sack fast and early to wake up fully
rested before attending the party. He couldn't be contained inside his
own skin, when thinking about the prospect of seeing Holaku's daughter
again within that same day...

As he slowly drifted off into sleep he dreamed that wherever he was, he
was actually already in that party but had just noticed it! He didn't
get time to think how it happened and why he'd only now realized where
he'd been all this time. Holaku was sitting on a throne across the huge
room and some of the vazirs were here and there chatting. But he knew
that he had not yet seen the daughter, so he made himself sure he'll
stay until she shows up. Also, he knew that he and Holaku both were
waiting for Tusi to arrive, because Holaku had something to ask from him.

But there was no sign of Tusi. At his home, he had come up with an idea
which needed the use of some tables of numbers kept at the observatory,
and he had chosen to go to the observatory in the evening, not even to
Hulaku's party where he was invited!

So after some time, at some point Holaku signaled to have a talk with
Ghotbeddin. A servant and one of the vazirs immediately came over to
Ghotbeddin and together walked to where Holaku was sitting.

Holaku to Ghotbeddin:

"They tell me you are a very smart man to be in the observatory,
helping someone like Tusi. Do you think you are as smart as Tusi?"

Ghotbeddin made a faint smile and said:

"Your Majesty, I am not blessed with as much talent as God has
bestowed upon Your Majesty _or_ Tusi."

Holaku:

"I have a task for Tusi to accomplish, but in his absence I want you
to do it."

Ghotbeddin:

"Your Majesty's wish is my utmost desire."

Holaku:

"In each of my parties, a session is always included in which a
chessboard is placed on the floor, with no chess pieces on it. There is
a contest, and the winner is blindfolded and given two random chess
pieces of same color - but not any pawns - out of my pocket, to place
somewhere on the chessboard by the winner, in two of the squares. Then
the blindfold is removed and the winner will look at the chessboard and
counts the number of different moves he can make with the chess pieces
from the squares that they are in. The winner will get as many gold
coins from me as that count is. If I know in advance which two pieces
will be given to the winner, I need to know how many gold coins I should
bring with me to the party, so I could never find myself with not enough
coins to give to the winner, and never carry with me even one gold coin
that would never be needed to be given to the winner. Find how many
coins I should bring with me to the party."

Ghotbeddin:

"Your Majesty's wish will undoubtedly get fulfilled."

How many gold coins should Holaku Khan take with him to his parties?
=====================================================================

huh?

I also will never read all that bullshit.



In the future, link to the original math problem and leave your
flamboyant, effeminate self out of it.




Physfitfreak

unread,
Feb 8, 2024, 9:51:55 PMFeb 8
to
On 2/8/2024 6:04 PM, DFS wrote:
> Talk's cheap


You've proven yourself in action too :)

Physfitfreak

unread,
Feb 9, 2024, 11:58:45 AMFeb 9
to
On 2/6/20966666624 6:19 PM, Physfitfreak wrote:
> Machine numbers are in binary form. But these machine numbers can be
> expressed in decimal machine numbers like:
>
> 0.d_1d_2 ... d_k x 10^n
>
> , where d_1 digit is _not_ zero, and d_2, d_3 ... d_k digits can each be
> an integer from zero to 9.


By the way, can FriCAS show the above math expression correctly in
pretty print? Diagon cannot! At least I don't know how to use it to
write that number in the familiar way.

Diagon seems to treat each digit as a separate number, and therefore
requires a math operation inbetween them! Hehe :) What a flaw. I just
noticed it.

But perhaps friCAS is like that too.




Stéphane CARPENTIER

unread,
Feb 9, 2024, 4:28:35 PMFeb 9
to
Le 06-02-2024, Physfitfreak <Physfi...@gmail.com> a écrit :
>
> You must understand the problem first. Any code monkey has good reading
> comprehension, otherwise they're just useless cause they won't know what
> it is that the employer wants them to do.

No employer will refuse to explain differently what has been
misunderstood. When an employer hires a programmer, he's not sure the
programmer knows the context in which the program will be used. The job
of the programmer is to develop a program, not to know every way in
which it can be used. You are like a lot of teachers I had: they never
went outside of their university but they believed they know what the
employers will need. And like you, they were just plain wrong.

--
Si vous avez du temps à perdre :
https://scarpet42.gitlab.io
It is loading more messages.
0 new messages