Math Is Fun Forum

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

You are not logged in.

#1801 2013-06-13 02:26:52

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

Re: Is this cool with you?

Hi Bobby,

I used similar to this:

bobbym wrote:

He wins half of it or loses half of it. The arithmetic was done after each toss using a TI - 92. at the end they decided on the rounding.


"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

#1802 2013-06-13 02:29:56

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

Re: Is this cool with you?

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

#1803 2013-06-13 03:02:32

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

Re: Is this cool with you?

Hi Bobby,


"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

#1804 2013-06-13 03:11:09

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

Re: Is this cool with you?

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

#1805 2013-06-13 03:51:46

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

Re: Is this cool with you?

Hi Bobby,

Thanks for that...saw it after typing this, which I'll post anyway. Our conclusions are the same.


"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

#1806 2013-06-13 03:53:02

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

Re: Is this cool with you?

And thanks too for the code. smile


"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

#1807 2013-06-13 03:55:38

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

Re: Is this cool with you?

Hi;

Okay, by the way I use a different formula that I made myself but I never noticed the connection with the interest formula.


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

#1808 2013-06-13 04:05:08

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

Re: Is this cool with you?

Would you like to show me? Or at least give me a clue as to which direction I should head in if I want to go it alone...in which case I wouldn't look at your code - if you do post it - until I collapse from mental exhaustion after trying unsuccessfully to make my own code.


"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

#1809 2013-06-13 04:09:16

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

Re: Is this cool with you?


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

#1810 2013-06-13 04:14:42

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

Re: Is this cool with you?

Hi Bobby,

Last edited by phrontister (2013-06-13 04:15:36)


"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

#1811 2013-06-13 04:16:46

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

Re: Is this cool with you?

Hi;

I will post the function that you just have to plug in the numbers. If you like it you can use it, if not you can use your own. Meanwhile, have a good night.


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

#1812 2013-06-13 18:27:51

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

Re: Is this cool with you?

Hi Bobby,

Thanks for the code, but I'm sorry, I don't know how to run it. I tried a few things but I don't understand what I'm doing and got nowhere. Could you please help me understand the code and let me know how to get it to work?

Meanwhile, I came up with my own code (very different from yours!) that gave the right answer for most ( sad ) of what I threw at it. I tested it on quite a range of numbers, in particular those whose fractional part was very close to zero or 0.5: eg,

432.98 (input 433) @ 28 tosses = 9 losses;
3.01 (input 3) @ 32 tosses = 15 losses;
28.51 (input 29) @ 24 tosses = 10 losses;
13.90 (input 14) @ 71 tosses = 69 losses (correct answer is 28, but the 4th element of b was less than the 28th and gave that odd result).

As you can see, I had trouble isolating the answer from the table produced by the compound interest formula. My idea was that the answer should be the number of tosses less the element closest to an integer. I know now that will lead to some errors, but I haven't found the solution to that. Maybe it doesn't exist with my compound interest formula and inputting a rounded integer for the payout.

I tried to plug the hole that was letting some bogus answers through with Select in a, and that did shut the door on some errors, but not all.

Last edited by phrontister (2013-06-13 18:45:01)


"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

#1813 2013-06-13 19:10:04

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

Re: Is this cool with you?

Hi phrontister;

Do you want an example of it s usage?


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

#1814 2013-06-13 19:23:52

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

Re: Is this cool with you?

Yes please! smile


"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

#1815 2013-06-13 19:31:23

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

Re: Is this cool with you?

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

#1816 2013-06-13 20:53:01

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

Re: Is this cool with you?

Thanks, Bobby...that works well.

I'd probably do it like this (my preference to get the prompt for when inputting a number of scenarios):

However, that gives the final payout sum, which isn't what I've been struggling with. I've been trying to find a formula that gives the number of losses from these known facts:
1. Starting sum in pocket
2. Percentage bet
3. Number of tosses (ie, total of winning and losing tosses) before Mad Archil calls the game off.
4. Final payout (rounded integer).

Given the rounded payout and the volatile nature of the different scenarios, I suspect that writing this up to cater for every scenario may be difficult.

My code from post #1812 nearly gets there, but occasionally a rogue result sneaks through. sad

Last edited by phrontister (2013-06-14 16:30:26)


"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

#1817 2013-06-13 21:12:29

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

Re: Is this cool with you?

Hi;

It is rule 4 that is causing the trouble. I do not think that you will find a trick that will work every time.


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

#1818 2013-06-13 21:35:54

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

Re: Is this cool with you?

Yes...I thought as much. Time to give up on it, I reckon, disappointing as that may be. Tea time for me now.


"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

#1819 2013-06-13 21:40:06

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

Re: Is this cool with you?

Hi;

There is no reason not to use what you have there in post #812. You can quickly check the answer using the exact formula.


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

#1820 2013-06-14 01:25:38

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

Re: Is this cool with you?

True. I'll have to settle for including that check if it can't all be done in one go. Thanks again for your help...I've learnt some more. smile


"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

#1821 2013-06-14 01:31:52

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

Re: Is this cool with you?

Hi;

You are a fast learner. I am very impressed with that.


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

#1822 2013-06-14 01:44:43

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

Re: Is this cool with you?

M's help files are excellent, and if I get stuck I widen my research on the www or ask you. There's usually an answer tucked away somewhere, but often not in terms I understand and that slows down progress.


"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

#1823 2013-06-14 01:47:44

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

Re: Is this cool with you?

I'll say it does! Teaching yourself is about the hardest thing I have ever tried to do. That is why I joined here, I learn something every day.


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

#1824 2013-06-14 01:51:54

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

Re: Is this cool with you?

Yes, me too. I'm glad I found MIF...I've learnt a lot here and am enjoying the experience.


"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

#1825 2013-06-14 01:58:59

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

Re: Is this cool with you?

How did you find the place?


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

Board footer

Powered by FluxBB