Designing a Logic Function for Airplane Seating Arrangements

In summary, In an airplane there are 16 seats, 4 for the airplane crew (pilots) and 12 for travelers. The first function is f=0*1*2*3+0*1*2*3*4*...*15 which is 1 only when all the seat belts are belted up. The second function is f2=((0*1*2*3)+(0*1*2*3*...*15))*(a*b*c*d...*p) which outputs a 1 when the seat is occupied, belted up, or not occupied, and outputs a zero when the seat is not occupied and the belt is not belted up.
  • #1
Drao92
72
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
  • #2
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.
 
  • #3
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:
  • #4
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.
 
  • #5
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:

Related to Designing a Logic Function for Airplane Seating Arrangements

What is a LOGIC function?

A LOGIC function is a mathematical function that takes one or more inputs and produces an output based on logical operations such as AND, OR, and NOT. These functions are commonly used in computer programming and digital logic circuits.

What are the different types of LOGIC functions?

There are several types of LOGIC functions, including AND, OR, NOT, NAND, NOR, and XOR. Each type performs a different logical operation on the inputs to produce an output.

How do I use a LOGIC function in my code?

The exact syntax for using a LOGIC function will vary depending on the programming language you are using. However, the general process involves specifying the inputs and the desired logical operation to perform on them, and then storing the output in a variable or using it in another part of your code.

What are the benefits of using LOGIC functions?

LOGIC functions allow for complex logical operations to be performed in a single statement, making code more efficient and easier to read. They are also essential for building digital circuits and performing calculations in computer programs.

Can I create my own custom LOGIC function?

Yes, many programming languages allow you to create custom functions, including LOGIC functions, to suit your specific needs. This can be useful if you have a unique logical operation that you need to perform frequently in your code.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
7
Views
788
  • Precalculus Mathematics Homework Help
Replies
7
Views
870
  • Precalculus Mathematics Homework Help
Replies
4
Views
789
  • Precalculus Mathematics Homework Help
Replies
13
Views
479
  • Precalculus Mathematics Homework Help
Replies
15
Views
808
  • Precalculus Mathematics Homework Help
Replies
7
Views
799
  • Introductory Physics Homework Help
Replies
4
Views
1K
  • Precalculus Mathematics Homework Help
Replies
12
Views
2K
  • Precalculus Mathematics Homework Help
Replies
2
Views
919
  • Precalculus Mathematics Homework Help
Replies
8
Views
2K
Back
Top