[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 114 KB, 686x327, No Title.jpg [View same] [iqdb] [saucenao] [google]
5947313 No.5947313 [Reply] [Original]

A little problem that you guys might be interested!

>> No.5947320

>>5947313
I cheated and used python to figure out the solution, and then processsed backward to infer a property and hence, a proof.

Should I give "clues", or let people think to it ? Fun problem, though. Where did you find it ? And what were the "conditions" ?

(I'm not absolutely sure of my proof now, I must rewrite it properly but I'm confident)

>> No.5947325

Do the cycles require n1 and n2 for completion, or can you simply use either n1 or n2 to create an empty bucket?

Question 2: What number provides a bucket A with more then 2 tokens?

>> No.5947328

>>5947325
I don't understand your first question... '~'

Question 2 : 3 for instance. (games ends with 3 coins in bucket 3)
...I think I missed your point too....

>> No.5947355

>>5947320
Hmm can you show the code?

>> No.5947372

>>5947355
Not any more...
That's why I did it in python, because it's interpreted...
so I just typed the thing as it comes to my mind...

I was creepy as fuck, but correct. But why ? I can write a proper one in C if you want...

>> No.5947384

>>5947372
I dont know C :/
But I would appreciate if you show me the print and explain!

>> No.5947477

>>5947372
how did you determine if it was going to terminate for a given number of buckets.

>> No.5947505

>>5947477

problem states that N is less than 1000

so that would be 999 buckets

>> No.5947513

>>5947384
here is a draft (without includes , namespace and shit).
Sorry it's in french (so I deleted the comments)
(adapted from a similar problem, I didn't know deque, very useful)


http://sebsauvage.net/paste/?d803be9e24b4d202#y9pepARwJ1Ba+F/+7TUq81mB/4zdqIQCvb+DelfG9yM=

>>5947477
see the code
I had no idea at first (python), I just told to myself, if it takes too much time, that's bad.

>> No.5947514

>>5947513
FYO, it gives me 20 as a result.

The interesting thing is the math proof, though.

>> No.5947566

>>5947514
>FYO
Don't ask me, I don't know what it means

>> No.5947580

>>947513
I wrote my own script without looking at yours. For n < 1000 I found that the following n lead to all tokens in the same bucket:
1
2
3
4
5
6
9
10
17
18
33
34
65
66
129
130
257
258
513
514

Did you find the same?

>> No.5947620
File: 16 KB, 1283x868, cycles.png [View same] [iqdb] [saucenao] [google]
5947620

>>5947580
me again

There is definitely some interesting algebra here. I modified my script to count the length of the repeating cycles for n that fail to terminate, then graphed it.

pic related, muh slopes

>> No.5947624

>>5947580
yep.
>>5947580
Don't u see the pattern ?

Now, the proof...

>> No.5947632

>>5947624
You mean that solutions come in adjacent pairs and the higher value is 2n - 2?

>> No.5947641

>>5947632
yeah :
2^k+1,2^k+2
k from 0 to 9
--> 20 solutions

(2^10+1>1000, so end of the story)

why ?...

>> No.5947682

anybody still here?

>> No.5947692

>>5947682
Not really, but /sci/ is a slow board... you can post, thread'll still be there tomorrow

>> No.5947720

>>5947641
it seems like it is because after the first pass around the circle you will have floor((n-1)/2) buckets remaining. which for these values will be a power of two.

From there it looks like it will keep reducing by factors of 2, once it gets to two it's obvious it will terminate.

the rest will eventually hit an odd number and go forever.

>> No.5947724

>>5947682
I just saw this thread for the first time (haven't been on today).
I am bad at programming but from what I've read in this thread, it should be a fun exercise to practice my programming and see what I find.

>> No.5947735

>>5947720
The idea I used is the same.

>the rest will eventually hit an odd number and go forever.
Maybe I did it in the bad way, but the "forever" part was hard to formalize.
I think there is a more straightforward path that the one I took.

Wait & See for OP...