现实生活中的XOR情况?

pot*_*bie 1 boolean-logic

我试图解释与OR逻辑相比的XOR逻辑.

或者例子很多,例如"我需要在里面或使用雨伞保持干燥",但XOR示例更难.

moo*_*e99 14

XOR就像是对你的女朋友作弊:如果你和她一个人就可以了,如果你和另一个女孩一个人就可以,如果你没有,或者两个你都搞砸了.

[没有女孩因为这个例子而受到伤害]


hus*_*sik 10

你的"OR"例子给出了"干燥",而我的"XOR"告诉"行动是否浪费".

如果你在里面使用伞==浪费.

如果你在外面而不使用伞==再次浪费.

如果你在不使用雨伞的时候在里面,那就可以了.

如果你在外面使用雨伞,那也没关系.

实际上,神经网络越来越受欢迎并将成为现实生活.另外,有很多xor例子用于神经网络训练,有很多这样的例子你需要有一把伞来保持干爽.

你应该为1和0赋予一些意义.

三倍XOR:

  Moving through time : yes=1, no=0
  Moving through space: yes=1, no=0
  Screaming           : yes=1, no=0

  Mission: escaping from a falling-piano.

  time                         :(1,0,0) => (1) see the future, 
                                                  call an ambulance


         space                 :(0,1,0) => (1) walk one step back
                                                  so piano misses you


                      scream   :(0,0,1) => (1) people hear you
                                               people help you get to
                                               emergency of hospital

 time     space                :(1,1,0) => (0) at that time and location, 
                                                  you are kept as hostage
                                                  in a robbery scene


 time                scream    :(1,0,1) => (0) yelling at wrong time,
                                                  will not save you


        space        scream    :(0,1,1) => (0) you evade the piano,
                                                  but you are still screaming,
                                                  :D

 time     space        scream  :(1,1,1) => (1) you see future and call ambulance,
                                                  also move 
                                                  now you are in robbery
                                                  but you scream 
                                                  so robbers escape
                                                  they had fake guns
                                                  you save money and life

        (none)                 :(0,0,0) => (0)  piano falls, noone hears
                                                   also they loot your body
                                                   epic items
Run Code Online (Sandbox Code Playgroud)


小智 5

可以把它想象成告诉孩子他们可以吃糖果或冰淇淋。但他们不能两者兼得!