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

You are not logged in.

## #1751 2013-04-18 02:52:58

bobbym
Administrator

Offline

### Re: Is this cool with you?

But they say it like this Yaaaaaaaaay geogebra!

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1752 2013-04-18 02:57:49

anonimnystefy
Real Member

Offline

### Re: Is this cool with you?

Yes, I know. I prefer the way they would say Go geogebra.

The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment

## #1753 2013-04-18 03:05:10

bobbym
Administrator

Offline

### Re: Is this cool with you?

Maybe the german is better, Ja Geogebra!

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1754 2013-04-18 03:13:45

anonimnystefy
Real Member

Offline

### Re: Is this cool with you?

I love the German accent. Actually, I love all accents except the American.

The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment

## #1755 2013-04-18 03:16:07

bobbym
Administrator

Offline

### Re: Is this cool with you?

Unless you are from the south where My geogebra becomes Ma geogebra.

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1756 2013-04-18 12:45:20

phrontister
Real Member

Offline

### Re: Is this cool with you?

Hi Bobby,

#### bobbym wrote:

New Problem:

A used car salesman has 8 lots with 100 cars each. He wants to repaint all his cars. Each day one of his employees picks 35 cars at random from all his cars and paints them. Then he returns them to the lots. Since they do not keep records some cars get painted more than once. After 23 days the manager would like to know how many cars have been painted. he wants to do this without going down to the lots. Can you figure it for him?

A says) 522.
B says) I do not have an answer but I know that A's answer is wrong.
C says) I got that, and it is definitely wrong.
D says) No answer yet.
E says) I got it!

I did a simulation in Excel and after just over 1 million iterations got about 514.67, which is very close to gAr's simulation result of about 514.4.

"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

## #1757 2013-04-18 16:55:32

bobbym
Administrator

Offline

### Re: Is this cool with you?

Hi Phrontister;

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1758 2013-04-19 01:37:06

phrontister
Real Member

Offline

### 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

## #1759 2013-04-19 01:41:10

bobbym
Administrator

Offline

### Re: Is this cool with you?

Hi;

3. Why is the output shown as a fraction instead of a decimal number?

You are working with exact arithmetic so the answer will be the exact answer. This will be very, very slow and unnecessary.

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1760 2013-04-19 02:09:20

phrontister
Real Member

Offline

### Re: Is this cool with you?

Hi Bobby,

This will be very, very slow and unnecessary.

True, but I got nowhere trying to understand the methods used by you, gAr and stefy because I haven't a clue about those more advanced approaches. So I opted just for the simulation, first in Excel and then in M, and am pleased I got them to work (clunkiness aside).

Anyway, the long processing time was just right for me to have a nice cup of coffee (latte) from a new pod machine I bought recently from the local supermarket: <\$100AU for coffee maker and milk frother.

"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

## #1761 2013-04-19 02:12:53

bobbym
Administrator

Offline

### Re: Is this cool with you?

Hi;

He probably reduced the fraction that is why there is a smaller number on the bottom than a 1000000.

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1762 2013-04-19 02:41:02

phrontister
Real Member

Offline

### Re: Is this cool with you?

Ah yes...obvious answer. Thanks!

"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

## #1763 2013-04-19 02:43:32

bobbym
Administrator

Offline

### Re: Is this cool with you?

I am buried right now but I will try to code a simulation for you. I will post it here. Maybe you will like it. And thanks for working on the problem!

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1764 2013-04-19 02:49:21

phrontister
Real Member

Offline

### Re: Is this cool with you?

Ok, looking forward to seeing it and learning some more M...which I already did a little with the simulation as some of the coding was new to me. I'm off to bed now so I'll catch you later.

"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

## #1765 2013-04-19 02:58:13

bobbym
Administrator

Offline

### Re: Is this cool with you?

Okay, you did very well with the M code. See you later.

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1766 2013-04-19 09:01:00

phrontister
Real Member

Offline

### Re: Is this cool with you?

Good morning, Bobby.

Last edited by phrontister (2013-04-19 09:05:31)

"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

## #1767 2013-04-19 09:09:32

bobbym
Administrator

Offline

### Re: Is this cool with you?

Hi;

You said: "Close to the exact answer of 514.0874001..."

Isn't that an 'exact' approximation?

It is accurate to all the digits displayed. The exact answer is a big fraction.

This is what I came up with but it is not faster ( it might be slower ) than yours.

#### Code:

```cars=Table[0,{800}];
numbers=Range[800];
fubar[n_]:=cars[[n]]=1;

Table[cars=0*cars;
Table[pcks=RandomSample[numbers,35];fubar/@pcks,{23}];
Count[cars,1],{10}]//Mean```

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1768 2013-04-19 14:25:05

phrontister
Real Member

Offline

### Re: Is this cool with you?

Hi Bobby,

Thanks for doing that code for me - I'll have a closer look at it tonight to try and understand it.

I ran it just now, and, as you thought, it's slower than mine. Your code for 1 million iterations ran for 2241 seconds, and mine for 1014 seconds.

My M code basically follows the path I took with Excel, but is much briefer than that of course.

I just found an error in my Excel approach to do with multiple automatic iterations, but I think that my basic idea there is sound...just HUGELY slower now.

Last edited by phrontister (2013-04-19 16:50:39)

"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

## #1769 2013-04-19 22:42:58

bobbym
Administrator

Offline

### Re: Is this cool with you?

Hi;

The procedural style seems to be beating the functional one here. Why that is, I do not know.

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1770 2013-04-19 23:52:31

phrontister
Real Member

Offline

### Re: Is this cool with you?

I wondered about that too but have no answer for it.

I think we should suggest to M that he package the nuts and bolts of my procedure into a super-fast function called PhroSim to encourage sales of M in used-car yards.

"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

## #1771 2013-04-20 00:02:04

bobbym
Administrator

Offline

### Re: Is this cool with you?

I will ask him the next time I see him but he is an obstinate guy.

Try this:

#### Code:

```Table[
DeleteDuplicates[Table[RandomSample[Range[800],35],{23}]//Flatten]//Length,{100000}]//Mean```

It uses many of your ideas but eliminates some of the procedural constructs.

Takes 41 seconds to do 100000 on my machine, a doggy dual core.

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1772 2013-04-20 00:37:36

phrontister
Real Member

Offline

### Re: Is this cool with you?

Wow! Had to get the fire extinguisher out to cool down my cpu for that one! BobSim runs 4 times faster than PhroSim. But I know why...your code is only 2/3rds the length of mine.

Took 25 seconds on my old dual core, so it would put wings onto a modern cpu.

Excellent!

"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

## #1773 2013-04-20 00:39:57

bobbym
Administrator

Offline

### Re: Is this cool with you?

Your dual core would blow the doors off of mine as we used to say.

We could try to compile it to make it faster.

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## #1774 2013-04-20 00:48:12

phrontister
Real Member

Offline

### Re: Is this cool with you?

I don't know how to compile, other than in LB.

I'll have to start thinking more in functional mode than in procedural, now that I've seen the benefit of it. But it's gonna be hard to convert that which is set in concrete.

"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

## #1775 2013-04-20 00:51:37

bobbym
Administrator

Offline

### Re: Is this cool with you?

They say once you learn procedural it is very hard to rewire your mind. It is very difficult for me too.

In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

## Board footer

Powered by FluxBB