Math Is Fun Forum

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

You are not logged in.

#1 2017-01-27 18:05:42

jacks
Member
Registered: 2012-11-21
Posts: 132

counting

finding number of arrangements of the word

in which neither
follow
nor
follow
  neither
follow
, is

Offline

#2 2017-01-27 18:29:38

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

Re: counting

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

#3 2017-01-27 18:33:00

thickhead
Member
Registered: 2016-04-16
Posts: 1,086

Re: counting

Seek some clarification.Is( O follow L follow A) i.e. O and A not next to each other allowed?


{1}Vasudhaiva Kutumakam.{The whole Universe is a family.}
(2)Yatra naaryasthu poojyanthe Ramanthe tatra Devataha
{Gods rejoice at those places where ladies are respected.}

Offline

#4 2017-01-27 19:12:01

thickhead
Member
Registered: 2016-04-16
Posts: 1,086

Re: counting


{1}Vasudhaiva Kutumakam.{The whole Universe is a family.}
(2)Yatra naaryasthu poojyanthe Ramanthe tatra Devataha
{Gods rejoice at those places where ladies are respected.}

Offline

#5 2017-01-30 05:24:18

thickhead
Member
Registered: 2016-04-16
Posts: 1,086

Re: counting

Is there no further discussion on this topic?


{1}Vasudhaiva Kutumakam.{The whole Universe is a family.}
(2)Yatra naaryasthu poojyanthe Ramanthe tatra Devataha
{Gods rejoice at those places where ladies are respected.}

Offline

#6 2017-01-30 12:31:05

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

Re: counting

I got that idea from here.

Although not defined in the puzzle wording, I've taken "follow" to mean "immediately follow": ie, the nominated letters are adjacent pairs, with the second being after the first (l to r).

Using M and Excel, I got the same answer by filtering out invalids from the list of permutations.

Last edited by phrontister (2017-01-30 12:51:24)


"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

#7 2017-01-30 12:56:15

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

Re: counting

That I believe is the correct answer for that particular interpretation of the problem.


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

#8 2017-01-30 13:29:02

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

Re: counting

Hi Bobby;

I used M to give me the list of permutations and pasted that into Excel where I could quickly filter out the invalids, leaving a count of 432.

I gave up trying to do all that in M because it was taking forever to work out how to select just the valid cases. My M knowledge in that area is very weak.


"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

#9 2017-01-30 15:18:22

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

Re: counting

Want some help with the M code?


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

#10 2017-01-30 17:14:14

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

Re: counting

Yes, please. I'd like to know in which direction to start looking, so I can save on shoe leather.


"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

#11 2017-01-30 17:57:02

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

Re: counting

s = Permutations[{o, r, a, c, l, e}, {6}];
DeleteCases[s, {___, a, o, ___} | {___, e, a, ___} | {___, o, e, ___}] // Length

That is one of just many possible ways. This way uses patterns


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

#12 2017-01-31 00:12:35

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

Re: counting

Works well!

I like that way, filtering out invalids.

I got the permutations like you did, but then got stuck trying to select valids.


"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

#13 2017-01-31 06:02:17

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

Re: counting

Hi;

A little bit difficult to select valids.


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

#14 2017-01-31 10:14:33

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

Re: counting

Yes, I can see that. My failing here was that when I couldn't succeed down that road I switched to the way I knew - filtering with Excel - instead of trying the same in M.

Thanks for your 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

#15 2017-01-31 10:37:21

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

Re: counting

when I couldn't succeed down that road I switched to the way I knew - filtering with Excel - instead of trying the same in M.

That is not a mistake. It is the first tenet of intelligent problem solving. Reduce all problems to ones you know how to solve. I suppose you have had to listen to me ramble on about the teakettle principle. My favorite two people who have had to endure my ranting are anonimnystefy and Agnishom. It is your turn now...

http://www.mathisfunforum.com/viewtopic … 05#p122105

Those two super giant intellects I was speaking to did not embrace the idea.
But the teakettle does not restrict you from improving. Instead of M to Excel then solve you can just use M to solve.


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

#16 2017-01-31 11:26:45

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

Re: counting

Ok...onwards and upwards.

mathsyperson was very insightful. Said some good stuff.

Last edited by phrontister (2017-01-31 11:30:41)


"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

#17 2017-01-31 14:16:11

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

Re: counting

Anyway, if the OP meant something else then it is all moot.


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

#18 2017-02-01 21:58:29

jacks
Member
Registered: 2012-11-21
Posts: 132

Re: counting

Thanks Admin, Bobbym,phrontister

Offline

#19 2017-02-01 22:04:23

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

Re: counting

Hi;

You checked the 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

#20 2017-02-02 04:51:15

thickhead
Member
Registered: 2016-04-16
Posts: 1,086

Re: counting

This is how I got my result
N(AE)=no.of arrangements where A and E come together as AE=5!=120
Similarly N(EO=N(OA)=120
N(OAE)=4!=N(AEO)=24
N(AE-OAE-AEO)=Number of arrangements where AE is neither immediately preceded by O nor  immediately followed by O=120-24-24=72
N(OA-OAE)=120-24=96
N(EO-AEO)=120-24=96
So the number of invalid arrangements=96+96+72+24+24=312
No of valid arrangements=720-312=408
Where did I err?


{1}Vasudhaiva Kutumakam.{The whole Universe is a family.}
(2)Yatra naaryasthu poojyanthe Ramanthe tatra Devataha
{Gods rejoice at those places where ladies are respected.}

Offline

#21 2017-02-02 06:24:49

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

Re: counting

It looks to me like there are intersections in your sets. So when you subtract them all you overcount.


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

#22 2017-02-03 01:11:37

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

Re: counting

I forget exactly how I arrived at my formula in post #6, but I think the method is wrong, even though it gives the correct answer.

I'm now getting this:

Last edited by phrontister (2017-02-04 13:21:10)


"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

#23 2017-02-03 01:28:49

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

Re: counting

Hi thickhead;

N(AE-OAE-AEO)=Number of arrangements where AE is neither immediately preceded by O nor immediately followed by O=120-24-24=72
N(OA-OAE)=120-24=96
N(EO-AEO)=120-24=96
Where did I err?

In the first equation you allowed for the occasions where O both precedes and follows AE, but in each of the other two equations you left an occasion out.


"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

#24 2017-02-04 00:48:23

thickhead
Member
Registered: 2016-04-16
Posts: 1,086

Re: counting

yes phrontister, I had hellucination.i wrote down religiously OAEO as mentioned in the problem, noted O should neither follow or precede AE. I thought OA and EO have no such restraint.but if I had written further the sequence AEO I would have realized. Perhaps in the background of my thoughts I felt it is because EAO/OEA  is not barred.


{1}Vasudhaiva Kutumakam.{The whole Universe is a family.}
(2)Yatra naaryasthu poojyanthe Ramanthe tatra Devataha
{Gods rejoice at those places where ladies are respected.}

Offline

#25 2017-02-04 01:00:15

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

Re: counting

Interestingly, this has a parallel with what is taking place in the other thread!


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