Designing a Logic Function for Airplane Seating Arrangements

  • Thread starter Thread starter Drao92
  • Start date Start date
  • Tags Tags
    Function Logic
AI Thread Summary
The discussion focuses on designing logic functions for airplane seating arrangements, specifically for crew and traveler seats. The first proposed function ensures that the output is one when all four crew seats are occupied, using a combination of binary variables. The second part of the discussion addresses the challenge of creating a function that indicates when all seat belts are fastened, even if some seats are unoccupied. Suggestions include using a combined 32-bit number to represent both seat occupancy and seat belt status, leading to a function that accounts for all possible seat and belt scenarios. The conversation emphasizes the importance of logical operations in determining the correct outputs for the seating arrangement functions.
Drao92
Messages
70
Reaction score
0
In an airplane there are 16 seats, 4 for the airplane crew (pilots) and 12 for travelers. I must write a logic function which is always one when the airplane crew is on their seats(4), how many people are in the airplane it doesn't matte (0-12)r.
My 1st idea is:
For each seat i define a variable a,b,c,d,..., a,b,c,d for the airplane crew. Then i make all the posible combinations when a,b,c,d ==1 and the rest is 0 and 1 in a logic table and then i find the function.
Is this correct?
My 2nd idea is:
If we care only about a,b,c,d isn't the function f=a*b*c*d which is 1 only when a,b,c,d is 1 :D ?
 
Physics news on Phys.org
That's sort of the idea ... you have a 16 bit number for the airline seats.
bits 0,1,2, and 3 are crew seats. So [anything]1111 = 1 in your truth table - where [anything] is any 12-bit binary number.

the function takes a 16 bit number input and returns a single bit that depends only on the four lowest order bits. So you need a way to remove the other 12 from contention.

Note: this is assuming designated seating for the crew.
 
Thanks for these details.
I made my function like:
f=0*1*2*3+0*1*2*3(4+5+...+15)
My teacher teached us to make the logic table then we construct the function( he didnt specify anything for this one) but if i take all the cases when 0,1,2,3 are 1 and the rest of bits can have 2^12 combinations if i am not wrong and this will take me years to do :D. I think that function is corect and it contains all the bits. If any of the crew bits is 0, the function is 0 and if all the crew bits are 1 its 1.

Also, if you have any other suggestion on the following question on the same problem.
it, the first one really helped me.
So, the problem says each seat has a seat belt and i have to make a function which is one when all the seat belts are belted up. My problem is that i don't know what to do if there is no traveler on the seat. Might be imposible to solve this one if we don't consider every seat occupied?
Or i have to use the first function( all seats are occupied).
Like if f2 is the second function f2=f*( function for the seat belts)? And it would be false if the seats are not occupied.
Also if i will use the first function for f2 i must changed it in f=(0*1*2*3)+(0*1*2*3*4*...*15).
Lets say a,b,c,...p are the 16 biits of the seat belts, then f2=((0*1*2*3)+(0*1*2*3*...*15))*(a*b*c*d...*p).
 
Last edited:
Basically there are 2^12 combinations which would output a 1, and 2^16-2^12 combinations which output a zero. Don't know what you are using for a function that it would take years to check the first four bits.

Would it help you if you could make an efficient operation? I don't know what you are expected to produce for an answer.

For the second problem, you are probably correct to assume they don't just want:
if X=0xFFFF then f(X)=1 else f(X)=0

If you already have a seat-occupation number, X, 16 bits wide, where a 1 indicates that a seat is occupied. You now introduce a second number for the seatbelt-status, Y, - also 16 bits wide, with "fastened"=1. You need to compare X and Y.

Hint: The condition that makes a 1 is whatever does not make a 0.
 
Ohh great, i undertood :D. Thanks a lot for suggestions.
For the second function i made in 2 ways, the one you suggested and this one.
I considered a 32 bits binary number, each pair of bits monitors if the seat is ocupied and if the seat belt is belted up.
And i made the folowing function B`+A*B, where A is the bit of seat belt and B is the bit of the seat and its one when the seat is ocupied, belted up, seat is not ocupied, belted up, seat is not ucipied, not belted up and zero when the seat is ocupied and belt is not belted up and i use OR for each pair and the result is my function :D.
 
Last edited:
I tried to combine those 2 formulas but it didn't work. I tried using another case where there are 2 red balls and 2 blue balls only so when combining the formula I got ##\frac{(4-1)!}{2!2!}=\frac{3}{2}## which does not make sense. Is there any formula to calculate cyclic permutation of identical objects or I have to do it by listing all the possibilities? Thanks
Essentially I just have this problem that I'm stuck on, on a sheet about complex numbers: Show that, for ##|r|<1,## $$1+r\cos(x)+r^2\cos(2x)+r^3\cos(3x)...=\frac{1-r\cos(x)}{1-2r\cos(x)+r^2}$$ My first thought was to express it as a geometric series, where the real part of the sum of the series would be the series you see above: $$1+re^{ix}+r^2e^{2ix}+r^3e^{3ix}...$$ The sum of this series is just: $$\frac{(re^{ix})^n-1}{re^{ix} - 1}$$ I'm having some trouble trying to figure out what to...
Back
Top