Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#3526 Re: Puzzles and Games » Sum of fractions which equals 1 » 2009-08-13 22:59:01

bobbym wrote:

Its ctrl + pause/break : this key is above the arrow keys (at the top).

Ah - found it! I'd never used that key before and must have skimmed over it when looking for it. sad

It stops program execution, as you said.

Thanks!

#3527 Re: Puzzles and Games » Sum of fractions which equals 1 » 2009-08-13 04:31:12

I don't have "break". My OS is Windows XP. I tried CTRL + all the buttons on my keyboard, but nothing except F10 did anything (F10 paused it, but I couldn't gain any further control over the program from there).

I'll have to ask LB, because the only way I can manually quit a program is via the Task Manager (CTRL + ALT + DELETE). And that's annoying.

#3528 Re: Puzzles and Games » Sum of fractions which equals 1 » 2009-08-13 01:41:08

Hi Bobby,

bobbym wrote:

Try this in LBasic: Don't use the input command to enter f. Just change it manually. We expect to count down from 10 by 1/3 until we get to 0. Watch what happens and then try 1/2,1/6,1/8,1/10,1/5 for f.

I tried those exercises and I see what you mean. 1/10 surprised me.

I changed your code to run to 200 to avoid the endless looping. Btw, I don't know how to stop the program mid-stream - do you?

For terminated results LBASIC prints just the integer "200", but for non-terminations it prints "200.0". I suppose LB is saying that the number is not an integer, and that the number of zeros preceding other decimal digits exceeds its precision limit.

If I use a for next loop we get the correct response.

I tried that, but I got the same incorrect responses as before. Maybe I didn't code it correctly. I'll try again...

Re your first workaround:

As you suggested, I changed the offending line. I came up with:

Same results as before, in the same time.

#3529 Re: Puzzles and Games » Archimedes' cattle problem » 2009-08-12 11:01:37

I only understand Part 1, Bobby, which is just a simple algebraic solution.

Part 2's solution uses advanced techniques that I have no idea about whatsoever, and I find Vardi's language and the concepts he presents just going straight over the top of my head. I think that trying to come to grips with it all would be very difficult for me, given my limited maths knowledge.

#3530 Re: Puzzles and Games » Crossing the acid river » 2009-08-12 03:46:59

Oh, I see. That changes things considerably.

In your first post you said:

These planks can support any amount of weight.

I took that to mean each plank could support 13 people...but maybe the planks are too short for that.

Before I rethink, could you tell me if piggy-backing is allowed? What about human pyramids? Or must they stand on their own two feet?

Do you mean that there can only be up to 6 people on a plank at any one time?

#3531 Re: Puzzles and Games » Archimedes' cattle problem » 2009-08-12 03:30:26

Hi Bobby,

bobbym wrote:

Post what you do understand.

I've set it out as best I can. My explanation is a bit amateurish, but it's step-by-step how I went about solving it, using algebra and substitutions.

Edit: Ignore the image below. It's been replaced by the one in the first hide box above, but I can't delete the original.

#3532 Re: Puzzles and Games » Crossing the acid river » 2009-08-11 23:54:07

Hi 1a2b3c2212,

1a2b3c2212 wrote:

...have any ideas how all 13 can cross in the shortest time? (that's the purpose actually =0 )

The shortest I found is as per my diagram A, with 10 plank placements.

Is there a shorter method? If so, by how much? I think I'd like something to aim for.

Anyway, I like solution B, where 2 planks are saved. They could come in very handy: for instance, when the group comes to the narrow, 'uncrossable' giant poisonous (of course) stinging nettle patch, one of their adroit members can use the 2 planks as stilts, march across to the other side where the 13-man helicopter is and fly back to rescue the rest of the group...but (of course) there's only just enough fuel to get him back to the group (would you believe it!), and so he picks up the (very long) unbreakable rope that's laying on the ground by the helicopter, ties one end of it to the tree and puts the rest of the coil into the helicopter, allowing it to unravel as he flies off towards his mates; whereupon reaching them they ingeniously use their spare unbreakable rope (prudently saved from a previous adventure) to tie the planks (oh...did I forget to mention that he brought them back with him?) to the legs of the helicopter to act as skis, hook the rope up to the winch in the helicopter, climb aboard and winch themselves through the poisonous nettles to the safety of the other side...where lies a terribly-treacherous tributary of the Acid River that can only be crossed with 2 planks!!

I'll have another look at my solution to see if I can shorten it.

Nice puzzle, by the way. I've enjoyed having a go at it (I was going to say "solving it", but it looks like I've still got work to do on it).

#3533 Re: Help Me ! » nice fact » 2009-08-11 22:41:49

Hi soroban,

soroban wrote:


. .

. .




.

I tested this in Excel...which found that it is true for 3645 of the 9000 numbers in the range 1000 to 9999.

I didn't try to weed out multiples of 1111 (or anything else).

Found by Excel:
5-digit results
10890: 3645 times
10989: 640 times

Example: 8991 - 1998 = 6993: 6993 + 3996 = 10989
I haven't tried to work out why, but of the numbers that I checked the middle two digits were always 99.

4-digit results
9999: 2880 times
1170, 1251, 1332, 1413, 1494, 1575, 1656, 1737, 1818 & 1998: a total of 3815 times

3-digit results
261, 342, 423, 504, 585, 666, 747 & 828: a total of 648 times

2-digit results
99: 162

1-digit results
Zero: 90

The digit-sum of the above multiple-digit numbers always reduces to 9: eg,
(a) 10989's digit-sum is 27, whose digit-sum is 9
(b) 9999's digit sum is 36, whose digit-sum is 9
(c) 747's digit sum is 18, whose digit-sum is 9

#3534 Re: Puzzles and Games » Sum of fractions which equals 1 » 2009-08-11 12:35:12

Hi Bobby,

Thanks for all of that! I could only look at it quickly this a.m. and I've got to run now, so I'll have a closer look at it tonight. 

bobbym wrote:

Workaround #2:

The principle of this workaround came to me in bed last night just before I went to sleep (my mind's most productive moments!), and I was going to post about it morning...but you've saved me the trouble.:)

#3535 Re: Puzzles and Games » Sum of fractions which equals 1 » 2009-08-11 07:44:34

bobbym wrote:

Go here to see a little bit what I mean. The first part with excel is meaningful.
http://www.wolfram.com/broadcast/screen … ghtanswer/

Yes - I think I can see that relying on results from fractions can, in some circumstances, produce errors.

Here's a fix I thought up that restricts the number of fractions in that line to one, and it occurs after all the other calculations are done:-

If (n(1) * (n(5) * 10 + n(6)) * (n(8) * 10 + n(9)) + n(4) * (n(2) * 10 + n(3)) * (n(8) * 10 + n(9)) + n(7) * (n(2) * 10 + n(3)) * (n(5) * 10 + n(6))) / ((n(2) * 10 + n(3)) * (n(5) * 10 + n(6)) * (n(8) * 10 + n(9))) = 1 Then
            nValids = nValids + 1

Is this the sort of thing you mean, Bobby? It seems a bit wordy...you've probably got a better way of expressing that.

The code runs fine, but a bit longer.

What's the other fix you've got in mind? (or the other two, if mine isn't one).

#3536 Re: Puzzles and Games » Archimedes' cattle problem » 2009-08-11 03:39:56

I'd already uninstalled GhostScript, Bobby, as I nearly never have to read .ps files. I can't see that I'd have much use for djvu or puppy, either.

I use PDF-XChange Viewer for pdf, as it has a few annotation tools that I find handy.

#3537 Re: Puzzles and Games » Sum of fractions which equals 1 » 2009-08-11 02:29:40

Hi Bobby,

bobbym wrote:

If (n(1) / (n(2) * 10 + n(3))) + (n(4) / (n(5) * 10 + n(6))) + (n(7) / (n(8) * 10 + n(9))) = 1 Then
            nValids = nValids + 1

My beef with her code is this line!

What beef is that? Do you have a fix for it, or a better approach altogether?

#3538 Re: Puzzles and Games » Sum of fractions which equals 1 » 2009-08-10 21:52:47

I was curious to find out how an experienced BASIC programmer would tackle this in BASIC, and as I use LibertyBASIC I posted a question on their forum this afternoon. Janet responded (verrrrry quickly!) with this code, which in 86 seconds finds that there is only one solution (the one quoted by Bobby...plus its 5 positional permutations):-

I haven't tried to understand the code yet, but I'll post it now anyway.

#3539 Re: Puzzles and Games » Archimedes' cattle problem » 2009-08-10 15:50:19

Hi Bobby,

bobbym wrote:

ps. files require ghost script to view. You can view them with almost any linux distro.

Yes - after I downloaded the .pdf file I installed GhostScript, and it read the .ps file. I prefer the .pdf.

I don't have linux.

I didn't know about Wolfram Alpha or online Mathematica...I'll have a look. Thanks.

#3540 Re: Puzzles and Games » Archimedes' cattle problem » 2009-08-10 12:26:22

Thanks, Bobby.

I downloaded Vardi's article. Most of the internet links I could find were to .ps files, for which it seems I need to install a reader my computer doesn't have. I found a .pdf file at:-
http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=35990630E61962A0BE5D8EDD171CB9B1?doi=10.1.1.33.4288&rep=rep1&type=pdf

I read the article, but the explanation to the part 2 solution, in particular, is way beyond my grasp and confirms that I'm doomed to limiting my experience with the cattle problem to part 1.

For part 1 Vardi mentions using Mathematica and gives the final equations for use with that program's Solve command. Again - too advanced for me.

My solution to part 1 is a simple, step-by-step algebraic one...which I'll post when I've set it out sufficiently well. Maybe others might like to try this non-computer approach in the meantime.

#3541 Re: Puzzles and Games » Joan's telephone number & my YOB » 2009-08-10 04:56:08

One last squeak before this puzzle disappears off the page and into oblivion (I'll just let it sink quietly to the bottom after this)...wave

I think I'll give up on the idea of interesting anybody in coming up with an Excel solution to Part B (although most of the spreadsheet construction is pretty straight forward, especially if using the hints I gave...but there are a couple of quite interesting bumps in the road, too).

I'll just mention that one of the two people whom I said in my first post had solved it used Mathematica, and I suspect that the other one did too - or something similar.

Also, anyone interested in a good prime-factorization function for Excel might like to have a look at the link I gave in the puzzle. The function can handle numbers up to 1e15, and on my computer takes just 2 seconds to determine that 999999999999989 is prime (much less than that for factorizing composite numbers).

The author very kindly included for me a handy optional argument that reverses the factor order - which is probably totally useless for any purpose other than my puzzle hmm. Factors are output in a comma-delimited string, containing repeat factors (powers), if any: eg, input "1926", output "2,3,3,107" (or, arranged in descending prime factor order: "107,3,3,2").

#3542 Re: Puzzles and Games » Sum of fractions which equals 1 » 2009-08-10 03:50:34

Hi Bobby,

If you have time, could you post the code for solving this in BASIC? That's the only language I 'know' atm - I'm hoping to venture into something else some day when I get some spare(!) time...maybe Python.

I've had a fair sort of a crack at it but am not getting anywhere with it because I haven't done much programming, and I'd like to learn. If I wrote the code myself I'm sure that running it would melt my cpu.

Thanks!

#3543 Puzzles and Games » Archimedes' cattle problem » 2009-08-10 01:35:06

phrontister
Replies: 11

I just saw Bobby's reference in Jane's "Pell's equation" thread to the "cattle of the sun" problem, which reminded me that I'd recently been introduced to it. It's commonly known as Archimedes' cattle problem, and much has been written about it.

The problem is in two parts: one that I managed to do smile and one that I didn't sad.  I enjoyed solving part 1, for which only high school maths is required. Part 2 requires something more advanced - like Pell's equation, for instance.

This link - http://www.cs.drexel.edu/~crorres/Archimedes/Cattle/Statement.html - contains the entire puzzle (in old poetic-style language) and the solution to both parts (for which Maple was used), but I'll post just the easier part in simple form:

The sun god had a herd of cattle consisting of bulls and cows, of which some were white, some black, some yellow and the rest dappled.

From among the bulls:
* the number of the white was one half plus one third the number of the black, plus the yellow
* the number of the black was one quarter plus one fifth the number of the dappled, plus the yellow
* the number of the dappled was one sixth plus one seventh the number of the white, plus the yellow.

From among the cows:
* the number of the white was one third plus one quarter the total of the black cattle
* the number of the black was one quarter plus one fifth the total of the dappled cattle
* the number of the dappled was one fifth plus one sixth the total of the yellow cattle
* the number of the yellow was one sixth plus one seventh the total of the white cattle.

What was the cattle composition for the smallest-possible herd?

The last half of the question isn't in the original, but I saw it somewhere and thought it was a good addition to obtain a unique solution - otherwise there are multiple solutions. I think I read that solving part 2 restricts part 1's solution to the smallest one, but I haven't tested that as I didn't solve part 2.

#3544 Re: Puzzles and Games » Crossing the acid river » 2009-08-09 06:03:48

Hi, Bobby...

Thanks! smile

I'll pass on your compliment to M$ Word's programmers. wink

#3545 Re: Puzzles and Games » Crossing the acid river » 2009-08-09 05:14:43

Hi 1a2b3c2212,

I found a solution - here's an image of it that I drew up in MS Word.

I've colour-coded the planks and numbered their positions/repositions.

There are 2 options: Option A, which enables retrieval of only 1 plank once they've crossed, and Option B, which enables retrieval of 2 planks. Option A completes in 1 less move.

I couldn't find a way of retrieving all 3 planks.

#3546 Re: Puzzles and Games » Longest last-letter sentence » 2009-08-08 15:38:03

Once everything goes, suddenly you understand
- dreams;
- surreal life energy;
- youth's surprisingly-yobbish, heartache-evoking, gestalt therapy yackety-yack;
- know-it-all, letter-perfect, terrifying "generals";
- slowly, yet turbulently, yshent (thence eschewed)

eschewed

#3549 Puzzles and Games » The missing dollar (& the 2 extra dollars) » 2009-08-04 16:07:47

phrontister
Replies: 8

Here's an oldie that I adapted to include a situation that actually occurred (with some narrative licence).

The first part is just the old "missing penny" puzzle (it's also known under several other names), while the second part is based on that puzzle but is an extra little teaser I thought up.

You'll solve it quicker than it takes to read!

smile

EDIT: Use the version in the 'puzzle' hide box above. It's clearer than the image below, and has copiable text. The image contains two versions of the puzzle in one, which I think happened when the forum changed servers. I've tried to delete it, but can't.

#3550 Re: Puzzles and Games » Chain Puzzles » 2009-08-04 07:13:05

Here's an image of the Excel worksheet that I used for testing my formula on the first 30 groups.

Board footer

Powered by FluxBB