Math Is Fun Forum

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

You are not logged in.

#26 2014-03-24 04:00:56

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: The counting frog.

My answer matches with gAr's.

Why are you hiding posts like #25? It contains no spoiler


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#27 2014-03-24 04:07:23

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.

I am rechecking the whole calculation again.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#28 2014-03-24 04:08:56

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: The counting frog.

You mean the program, right?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#29 2014-03-24 04:14:40

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.

The program is only doing what I told it to do. There was a calculation I used.

I only hope I was right else phrontister is going to be really annoyed at me.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#30 2014-03-24 04:16:22

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: The counting frog.

phrontister is wrong anyway.

Will you post a picture of the exploding frog?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#31 2014-03-24 04:19:21

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.

Yes, I will but first the mystery must be solved.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#32 2014-03-24 04:28:19

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: The counting frog.

Hi bobbym,

Okay, but I think I have translated your question to algorithm correctly.
Also,


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#33 2014-03-24 04:34:13

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.

Hi gAr;

It is looking like that when I formulated the problem I made the frog eat the first fly. In the Josephus problem the first one is [not] eaten. I will rewrite my answer.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#34 2014-03-24 04:42:40

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: The counting frog.

Hi,

Yes, we need to tweak the code or input.
Anyway, my answer is for your question..


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#35 2014-03-24 04:49:29

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#36 2014-03-24 04:52:50

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: The counting frog.

Their list starts from 0, you took that to consideration?


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#37 2014-03-24 04:55:43

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.

Yes, there problem does not kill the starting fly. Mine does. In other words mine kills the first fly it lands on and then jumps. The regular Josephus, jumps from the first fly without killing him.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#38 2014-03-24 05:07:15

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: The counting frog.

Yes, tweak the input: let it be 2, 3, 4 ... 2014 instead of 0, 1 ... 2013
Worked for the python program there.


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#39 2014-03-24 05:10:12

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.

Hi;

It gets 1107 which still does not agree.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#40 2014-03-24 05:15:24

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: The counting frog.

For the input I suggested?


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#41 2014-03-24 05:17:00

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.

Hi;

Yes, for 2,3,4,...2014


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#42 2014-03-24 05:28:46

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: The counting frog.

Did you nest n-2 times instead of n-1?


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#43 2014-03-24 05:32:26

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.

Hi gAr;

I have some working code now. I rewrote in a form I can understand.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#44 2014-03-24 05:49:30

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: The counting frog.

Hi bobbym,

Started up raspbian to check the Mm code.
What I thought worked:


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#45 2014-03-24 06:18:47

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.

hi gAr;


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#46 2014-03-24 11:15:50

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,810

Re: The counting frog.

Hi,

Finally ironed out my errors and got there!

If the frog hadn't consumed the flies at such dazzling speed and allowed adequate digestion time to avoid exploding, he could have got the last one as well...during lap 135. But, given the number of extra laps required for the frog to get there after eating his 2013th fly, and also taking into account the frog's reduced speed by then due to wind-drag on his bloated stomach, the fly might have seen him coming by then and flown away in time! tongue


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#47 2014-03-24 11:53:50

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.

Hi;


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#48 2014-03-24 12:32:21

ShivamS
Member
Registered: 2011-02-07
Posts: 3,648

Re: The counting frog.

I don't understand what's happening...

Offline

#49 2014-03-24 12:36:11

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: The counting frog.

Hi;


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#50 2014-03-24 12:41:38

ShivamS
Member
Registered: 2011-02-07
Posts: 3,648

Re: The counting frog.

It's close but I have gotten multiple answers. The first time I got the same as phronister's but then I realized it was because we didn't take the spaces out. After that, I've gotten another weird one and then this. I'll try again.

Offline

Board footer

Powered by FluxBB